fix invalid registry path ends with 'master' or 'worker' (#14328)

Co-authored-by: Zinway Liu <zinway.liu@ucloud.cn>
Co-authored-by: Aaron Wang <wangweirao16@gmail.com>
This commit is contained in:
Zinway 2023-09-01 15:11:49 +08:00 committed by GitHub
parent 7640c29495
commit 96041e3876
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -210,11 +210,11 @@ public class RegistryClient {
}
public boolean isMasterPath(String path) {
return path != null && path.startsWith(RegistryNodeType.MASTER.getRegistryPath());
return path != null && path.startsWith(RegistryNodeType.MASTER.getRegistryPath() + Constants.SINGLE_SLASH);
}
public boolean isWorkerPath(String path) {
return path != null && path.startsWith(RegistryNodeType.WORKER.getRegistryPath());
return path != null && path.startsWith(RegistryNodeType.WORKER.getRegistryPath() + Constants.SINGLE_SLASH);
}
public Collection<String> getChildrenKeys(final String key) {