You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@stratos.apache.org by im...@apache.org on 2014/12/26 12:06:52 UTC
[3/3] stratos git commit: Adding payload parameters to kubernetes
cluster context
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 <im...@apache.org>
Authored: Fri Dec 26 16:36:35 2014 +0530
Committer: Imesh Gunaratne <im...@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());