stratos-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From im...@apache.org
Subject stratos git commit: Setting kubernetes master ip address as the member's default private & public up addresses
Date Fri, 26 Dec 2014 11:43:59 GMT
Repository: stratos
Updated Branches:
  refs/heads/master 669369670 -> d41193cb7


Setting kubernetes master ip address as the member's default private & public up addresses


Project: http://git-wip-us.apache.org/repos/asf/stratos/repo
Commit: http://git-wip-us.apache.org/repos/asf/stratos/commit/d41193cb
Tree: http://git-wip-us.apache.org/repos/asf/stratos/tree/d41193cb
Diff: http://git-wip-us.apache.org/repos/asf/stratos/diff/d41193cb

Branch: refs/heads/master
Commit: d41193cb7a52e11a7353bd2c036c68257170c6d6
Parents: 6693696
Author: Imesh Gunaratne <imesh@apache.org>
Authored: Fri Dec 26 17:13:47 2014 +0530
Committer: Imesh Gunaratne <imesh@apache.org>
Committed: Fri Dec 26 17:13:47 2014 +0530

----------------------------------------------------------------------
 .../controller/iaases/kubernetes/KubernetesIaas.java   | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/stratos/blob/d41193cb/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/iaases/kubernetes/KubernetesIaas.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/iaases/kubernetes/KubernetesIaas.java
b/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/iaases/kubernetes/KubernetesIaas.java
index e438d50..376d9f1 100644
--- a/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/iaases/kubernetes/KubernetesIaas.java
+++ b/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/iaases/kubernetes/KubernetesIaas.java
@@ -228,7 +228,8 @@ public class KubernetesIaas extends Iaas {
                 }
 
                 // Create member context
-                MemberContext newMemberContext = createNewMemberContext(memberContext, pod);
+                String memberIp = kubernetesMasterIp;
+                MemberContext newMemberContext = createNewMemberContext(memberContext, pod,
memberIp);
                 CloudControllerContext.getInstance().addMemberContext(newMemberContext);
 
                 // wait till pod status turns to running and send member spawned.
@@ -258,7 +259,7 @@ public class KubernetesIaas extends Iaas {
         }
     }
 
-    private MemberContext createNewMemberContext(MemberContext memberContext, Pod pod) {
+    private MemberContext createNewMemberContext(MemberContext memberContext, Pod pod, String
memberIp) {
         MemberContext newMemberContext = new MemberContext();
         newMemberContext.setCartridgeType(memberContext.getCartridgeType());
         newMemberContext.setClusterId(memberContext.getClusterId());
@@ -267,10 +268,10 @@ public class KubernetesIaas extends Iaas {
         newMemberContext.setNetworkPartitionId(memberContext.getNetworkPartitionId());
         newMemberContext.setPartition(memberContext.getPartition());
         newMemberContext.setInstanceId(pod.getId());
-        newMemberContext.setDefaultPrivateIP(pod.getCurrentState().getHostIP());
-        newMemberContext.setPrivateIPs(new String[]{pod.getCurrentState().getHostIP()});
-        newMemberContext.setDefaultPublicIP(pod.getCurrentState().getHostIP());
-        newMemberContext.setPublicIPs(new String[]{pod.getCurrentState().getHostIP()});
+        newMemberContext.setDefaultPrivateIP(memberIp);
+        newMemberContext.setPrivateIPs(new String[]{memberIp});
+        newMemberContext.setDefaultPublicIP(memberIp);
+        newMemberContext.setPublicIPs(new String[]{memberIp});
         newMemberContext.setInitTime(memberContext.getInitTime());
         newMemberContext.setProperties(memberContext.getProperties());
         return newMemberContext;


Mime
View raw message