From d45bd6e853e2a7067080c23b5511736c93f76afa Mon Sep 17 00:00:00 2001 From: lasinducharith Date: Mon, 17 Aug 2015 08:49:18 +0530 Subject: [PATCH] Revert "STRATOS-1499 - setting auto increment cluster-id as kubernetes serviceLabel" This reverts commit 5515a5c586c20fa5c73ec9cf7a198622434bf6bd. --- .../domain/kubernetes/KubernetesClusterContext.java | 6 ------ .../cloud/controller/iaases/kubernetes/KubernetesIaas.java | 3 +-- 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/domain/kubernetes/KubernetesClusterContext.java b/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/domain/kubernetes/KubernetesClusterContext.java index 8e1bdd9756..38c49a039e 100644 --- a/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/domain/kubernetes/KubernetesClusterContext.java +++ b/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/domain/kubernetes/KubernetesClusterContext.java @@ -48,7 +48,6 @@ public class KubernetesClusterContext implements Serializable { private transient KubernetesApiClient kubApi; private AtomicLong serviceSeqNo; private AtomicLong podSeqNo; - private AtomicLong clusterSeqNo; public KubernetesClusterContext(String id, String masterIp, String masterPort, int lowerPort, int upperPort) { servicePorts = new ArrayList(); @@ -62,7 +61,6 @@ public KubernetesClusterContext(String id, String masterIp, String masterPort, i this.setKubApi(new KubernetesApiClient(getEndpoint(masterIp, masterPort))); this.serviceSeqNo = new AtomicLong(); this.podSeqNo = new AtomicLong(); - this.clusterSeqNo = new AtomicLong(); } @@ -149,10 +147,6 @@ public AtomicLong getPodSeqNo() { return podSeqNo; } - public AtomicLong getClusterSeqNo(){ - return clusterSeqNo; - } - @Override public int hashCode() { final int prime = 31; 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 fe1d49f484..22f3c9bbf2 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 @@ -510,8 +510,7 @@ private void createKubernetesServices(KubernetesApiClient kubernetesApi, Cluster // Find next service sequence no long serviceSeqNo = kubernetesClusterContext.getServiceSeqNo().incrementAndGet(); String serviceId = KubernetesIaasUtil.fixSpecialCharacters("service" + "-" + (serviceSeqNo)); - long clusterSeqNo = kubernetesClusterContext.getClusterSeqNo().incrementAndGet(); - String serviceLabel = KubernetesIaasUtil.fixSpecialCharacters("cluster" + "-" + (clusterSeqNo)); + String serviceLabel = KubernetesIaasUtil.fixSpecialCharacters(clusterId); if (log.isInfoEnabled()) { log.info(String.format("Creating kubernetes service: [cluster] %s [service] %s " +