Fix service group name when upgrading. (#5674)
* [ISSUE #5671] Prefer serviceV2.groupName using groupName in serviceV1.name * [ISSUE #5671] Add groupName to service when creating by v1 operator
This commit is contained in:
parent
6afcb059e0
commit
b6d96b69c7
@ -61,6 +61,7 @@ public class ServiceOperatorV1Impl implements ServiceOperator {
|
||||
service.setMetadata(metadata.getExtendData());
|
||||
service.setSelector(metadata.getSelector());
|
||||
service.setNamespaceId(namespaceId);
|
||||
service.setGroupName(NamingUtils.getGroupName(serviceName));
|
||||
|
||||
// now valid the service. if failed, exception will be thrown
|
||||
service.setLastModifiedMillis(System.currentTimeMillis());
|
||||
|
@ -151,7 +151,7 @@ public class ServiceChangeV1Task extends AbstractDelayTask {
|
||||
|
||||
private com.alibaba.nacos.naming.core.v2.pojo.Service transfer(Service service, boolean ephemeral) {
|
||||
return com.alibaba.nacos.naming.core.v2.pojo.Service
|
||||
.newService(service.getNamespaceId(), service.getGroupName(),
|
||||
.newService(service.getNamespaceId(), NamingUtils.getGroupName(service.getName()),
|
||||
NamingUtils.getServiceName(service.getName()), ephemeral);
|
||||
}
|
||||
|
||||
|
@ -71,7 +71,7 @@ public class AsyncServicesCheckTask extends AbstractExecuteTask {
|
||||
if (upgradeJudgement.isUseGrpcFeatures()) {
|
||||
return;
|
||||
}
|
||||
String groupName = serviceV1.getGroupName();
|
||||
String groupName = NamingUtils.getGroupName(serviceV1.getName());
|
||||
String serviceName = NamingUtils.getServiceName(fullServiceName);
|
||||
com.alibaba.nacos.naming.core.v2.pojo.Service serviceV2 = com.alibaba.nacos.naming.core.v2.pojo.Service
|
||||
.newService(namespace, groupName, serviceName);
|
||||
|
Loading…
Reference in New Issue
Block a user