You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@servicecomb.apache.org by GitBox <gi...@apache.org> on 2018/06/05 02:34:25 UTC

[GitHub] laijianbin closed pull request #747: [SCB-595]Compatible with old SC

laijianbin closed pull request #747: [SCB-595]Compatible with old SC
URL: https://github.com/apache/incubator-servicecomb-java-chassis/pull/747
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/service-registry/src/main/java/org/apache/servicecomb/serviceregistry/registry/AbstractServiceRegistry.java b/service-registry/src/main/java/org/apache/servicecomb/serviceregistry/registry/AbstractServiceRegistry.java
index 11e91ff97..4bf8d858d 100644
--- a/service-registry/src/main/java/org/apache/servicecomb/serviceregistry/registry/AbstractServiceRegistry.java
+++ b/service-registry/src/main/java/org/apache/servicecomb/serviceregistry/registry/AbstractServiceRegistry.java
@@ -184,6 +184,16 @@ private void loadFrameworkVersions() {
     framework.setVersion(FrameworkVersions.allVersions());
     microservice.setFramework(framework);
     microservice.setRegisterBy(CONFIG_DEFAULT_REGISTER_BY);
+    ServiceCenterInfo info = srClient.getServiceCenterInfo();
+    while (info == null) {
+      return;
+    }
+    String serviceCenterVersion = info.getVersion();
+    String validateSuccessVersion = "1.0.0"; 
+    int compareResult = serviceCenterVersion.compareTo(validateSuccessVersion);// 如果大于1.0.0,不需要兼容
+    if (compareResult < 1) {
+      microservice.getFramework().setVersion(null);
+    }  
   }
 
 


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services