stratos-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From im...@apache.org
Subject [1/2] stratos git commit: Fixing logic which set container image id
Date Mon, 22 Dec 2014 08:51:01 GMT
Repository: stratos
Updated Branches:
  refs/heads/master 2bb77145d -> 7fa3c1701


Fixing logic which set container image id


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

Branch: refs/heads/master
Commit: 7fa3c17015ab303f213db403d7bde9ad53b4520c
Parents: e623786
Author: Imesh Gunaratne <imesh@apache.org>
Authored: Mon Dec 22 14:20:41 2014 +0530
Committer: Imesh Gunaratne <imesh@apache.org>
Committed: Mon Dec 22 14:20:55 2014 +0530

----------------------------------------------------------------------
 ...ContainerClusterContextToKubernetesContainer.java | 15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/stratos/blob/7fa3c170/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/functions/ContainerClusterContextToKubernetesContainer.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/functions/ContainerClusterContextToKubernetesContainer.java
b/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/functions/ContainerClusterContextToKubernetesContainer.java
index 4db6ea8..274ab75 100644
--- a/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/functions/ContainerClusterContextToKubernetesContainer.java
+++ b/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/functions/ContainerClusterContextToKubernetesContainer.java
@@ -59,7 +59,20 @@ public class ContainerClusterContextToKubernetesContainer implements Function<Me
             throw new RuntimeException(message);
         }
 
-        container.setImage(cartridge.getContainer().getImageName());
+        Partition partition = memberContext.getPartition();
+        if(partition == null) {
+            String message = "Partition not found in member context: [member-id] " + memberContext.getMemberId();
+            log.error(message);
+            throw new RuntimeException(message);
+        }
+
+        IaasProvider iaasProvider = cartridge.getIaasProviderOfPartition(partition.getId());
+        if(iaasProvider == null) {
+            String message = "Could not find iaas provider: [partition-id] " + partition.getId();
+            log.error(message);
+            throw new RuntimeException(message);
+        }
+        container.setImage(iaasProvider.getImage());
         container.setPorts(getPorts(cartridge));
         container.setEnv(getEnvironmentVariables(memberContext, clusterContext));
         return container;


Mime
View raw message