From abdc48fc84761e5ac78e3613c2cee06c13d3c0bf Mon Sep 17 00:00:00 2001 From: nkorange Date: Thu, 25 Oct 2018 15:56:02 +0800 Subject: [PATCH] Fix register instance with customized cluster name failed bug. --- api/pom.xml | 2 +- .../main/java/com/alibaba/nacos/api/naming/pojo/Cluster.java | 2 +- client/pom.xml | 2 +- common/pom.xml | 2 +- config/pom.xml | 2 +- console/pom.xml | 2 +- core/pom.xml | 2 +- distribution/pom.xml | 2 +- example/pom.xml | 2 +- naming/pom.xml | 2 +- .../src/main/java/com/alibaba/nacos/naming/core/IpAddress.java | 2 +- .../src/main/java/com/alibaba/nacos/naming/web/ApiCommands.java | 2 +- pom.xml | 2 +- test/pom.xml | 2 +- 14 files changed, 14 insertions(+), 14 deletions(-) diff --git a/api/pom.xml b/api/pom.xml index 17f025493..1b49ba3ac 100644 --- a/api/pom.xml +++ b/api/pom.xml @@ -16,7 +16,7 @@ com.alibaba.nacos nacos-all - 0.2.0-SM-SNAPSHOT + 0.3.0-RC1 4.0.0 diff --git a/api/src/main/java/com/alibaba/nacos/api/naming/pojo/Cluster.java b/api/src/main/java/com/alibaba/nacos/api/naming/pojo/Cluster.java index bcb0d9cd5..2d88353d4 100644 --- a/api/src/main/java/com/alibaba/nacos/api/naming/pojo/Cluster.java +++ b/api/src/main/java/com/alibaba/nacos/api/naming/pojo/Cluster.java @@ -33,7 +33,7 @@ public class Cluster { /** * Name of cluster */ - private String name = Constants.NAMING_DEFAULT_CLUSTER_NAME; + private String name; /** * Health check config of this cluster diff --git a/client/pom.xml b/client/pom.xml index 9e3f6315f..e44c937bc 100644 --- a/client/pom.xml +++ b/client/pom.xml @@ -16,7 +16,7 @@ com.alibaba.nacos nacos-all - 0.2.0-SM-SNAPSHOT + 0.3.0-RC1 ../pom.xml diff --git a/common/pom.xml b/common/pom.xml index 9c402f91e..d2cd7d399 100644 --- a/common/pom.xml +++ b/common/pom.xml @@ -18,7 +18,7 @@ com.alibaba.nacos nacos-all - 0.2.0-SM-SNAPSHOT + 0.3.0-RC1 ../pom.xml 4.0.0 diff --git a/config/pom.xml b/config/pom.xml index a584e5285..071879dd5 100644 --- a/config/pom.xml +++ b/config/pom.xml @@ -17,7 +17,7 @@ com.alibaba.nacos nacos-all - 0.2.0-SM-SNAPSHOT + 0.3.0-RC1 4.0.0 diff --git a/console/pom.xml b/console/pom.xml index b3bd10792..c56c22812 100644 --- a/console/pom.xml +++ b/console/pom.xml @@ -18,7 +18,7 @@ com.alibaba.nacos nacos-all - 0.2.0-SM-SNAPSHOT + 0.3.0-RC1 nacos-console diff --git a/core/pom.xml b/core/pom.xml index dcf3a1080..3ee33fc0a 100644 --- a/core/pom.xml +++ b/core/pom.xml @@ -18,7 +18,7 @@ com.alibaba.nacos nacos-all - 0.2.0-SM-SNAPSHOT + 0.3.0-RC1 ../pom.xml diff --git a/distribution/pom.xml b/distribution/pom.xml index 0cc642425..87a4fb856 100644 --- a/distribution/pom.xml +++ b/distribution/pom.xml @@ -18,7 +18,7 @@ com.alibaba.nacos nacos-all - 0.2.0-SM-SNAPSHOT + 0.3.0-RC1 ../pom.xml diff --git a/example/pom.xml b/example/pom.xml index 0ba10c714..35faf94c7 100644 --- a/example/pom.xml +++ b/example/pom.xml @@ -18,7 +18,7 @@ com.alibaba.nacos nacos-all - 0.2.0-SM-SNAPSHOT + 0.3.0-RC1 ../pom.xml diff --git a/naming/pom.xml b/naming/pom.xml index b83ae9aa2..535e63f1c 100644 --- a/naming/pom.xml +++ b/naming/pom.xml @@ -18,7 +18,7 @@ com.alibaba.nacos nacos-all - 0.2.0-SM-SNAPSHOT + 0.3.0-RC1 ../pom.xml diff --git a/naming/src/main/java/com/alibaba/nacos/naming/core/IpAddress.java b/naming/src/main/java/com/alibaba/nacos/naming/core/IpAddress.java index 02bc59db9..e449d916d 100644 --- a/naming/src/main/java/com/alibaba/nacos/naming/core/IpAddress.java +++ b/naming/src/main/java/com/alibaba/nacos/naming/core/IpAddress.java @@ -305,7 +305,7 @@ public class IpAddress extends Instance implements Comparable { } public String generateInstanceId() { - return getIp() + "#" + getPort() + "#" + getCluster().getName() + "#" + getService().getName(); + return getIp() + "#" + getPort() + "#" + getClusterName() + "#" + getService().getName(); } @Override diff --git a/naming/src/main/java/com/alibaba/nacos/naming/web/ApiCommands.java b/naming/src/main/java/com/alibaba/nacos/naming/web/ApiCommands.java index 581407ea4..05bed9657 100644 --- a/naming/src/main/java/com/alibaba/nacos/naming/web/ApiCommands.java +++ b/naming/src/main/java/com/alibaba/nacos/naming/web/ApiCommands.java @@ -1203,7 +1203,6 @@ public class ApiCommands { ipObj.put("metadata", ip.getMetadata()); ipObj.put("enabled", ip.isEnabled()); ipObj.put("weight", ip.getWeight()); - hosts.add(ipObj); } @@ -1216,6 +1215,7 @@ public class ApiCommands { result.put("lastRefTime", System.currentTimeMillis()); result.put("checksum", domObj.getChecksum() + System.currentTimeMillis()); result.put("useSpecifiedURL", false); + result.put("clusters", clusters); result.put("env", env); result.put("metadata",domObj.getMetadata()); return result; diff --git a/pom.xml b/pom.xml index e77f0a84d..9a8da00f4 100644 --- a/pom.xml +++ b/pom.xml @@ -21,7 +21,7 @@ 2018 com.alibaba.nacos nacos-all - 0.2.0-SM-SNAPSHOT + 0.3.0-RC1 pom Alibaba NACOS ${project.version} diff --git a/test/pom.xml b/test/pom.xml index 8fea850c5..014ee2e26 100644 --- a/test/pom.xml +++ b/test/pom.xml @@ -17,7 +17,7 @@ com.alibaba.nacos nacos-all - 0.2.0-SM-SNAPSHOT + 0.3.0-RC1 ../pom.xml 4.0.0