stratos-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From im...@apache.org
Subject [3/3] stratos git commit: Adding payload parameters to kubernetes cluster context
Date Fri, 26 Dec 2014 11:06:52 GMT
Adding payload parameters to kubernetes cluster context


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

Branch: refs/heads/master
Commit: 6693696703c39609542ecaf724ef3844d105988d
Parents: 12457b5
Author: Imesh Gunaratne <imesh@apache.org>
Authored: Fri Dec 26 16:36:35 2014 +0530
Committer: Imesh Gunaratne <imesh@apache.org>
Committed: Fri Dec 26 16:36:35 2014 +0530

----------------------------------------------------------------------
 .../controller/iaases/kubernetes/KubernetesIaas.java | 15 +++++++++++++++
 1 file changed, 15 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/stratos/blob/66936967/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 6084bdf..e438d50 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
@@ -33,6 +33,7 @@ import org.apache.stratos.cloud.controller.iaases.PartitionValidator;
 import org.apache.stratos.cloud.controller.services.impl.CloudControllerServiceUtil;
 import org.apache.stratos.cloud.controller.util.CloudControllerUtil;
 import org.apache.stratos.cloud.controller.util.PodActivationWatcher;
+import org.apache.stratos.common.Property;
 import org.apache.stratos.common.beans.NameValuePair;
 import org.apache.stratos.common.constants.StratosConstants;
 import org.apache.stratos.cloud.controller.domain.kubernetes.KubernetesCluster;
@@ -56,6 +57,7 @@ public class KubernetesIaas extends Iaas {
     private static final long POD_CREATION_TIMEOUT = 120000; // 2 min
     private static final String PAYLOAD_PARAMETER_SEPARATOR = ",";
     private static final String PAYLOAD_PARAMETER_NAME_VALUE_SEPARATOR = "=";
+    private static final String PAYLOAD_PARAMETER_PREFIX = "payload_parameter.";
 
     private PartitionValidator partitionValidator;
     private List<NameValuePair> payload;
@@ -173,6 +175,19 @@ public class KubernetesIaas extends Iaas {
                         kubernetesCluster.getKubernetesMaster().getProperties(), StratosConstants.KUBERNETES_MASTER_PORT,
                         StratosConstants.KUBERNETES_MASTER_DEFAULT_PORT);
 
+                // Add kubernetes cluster payload parameters to payload
+                if((kubernetesCluster.getProperties() != null) &&
+                        (kubernetesCluster.getProperties().getProperties() != null)) {
+                    for(Property property : kubernetesCluster.getProperties().getProperties())
{
+                        if(property != null) {
+                            if(property.getName().startsWith(PAYLOAD_PARAMETER_PREFIX)) {
+                                String name = property.getName().replace(PAYLOAD_PARAMETER_PREFIX,
"");
+                                payload.add(new NameValuePair(name, property.getValue()));
+                            }
+                        }
+                    }
+                }
+
                 KubernetesClusterContext kubClusterContext = getKubernetesClusterContext(kubernetesClusterId,
                         kubernetesMasterIp, kubernetesMasterPort, kubernetesPortRange.getUpper(),
                         kubernetesPortRange.getLower());


Mime
View raw message