Browse Source

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>
3.2.1-prepare
Zinway 1 year ago committed by GitHub
parent
commit
96041e3876
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      dolphinscheduler-registry/dolphinscheduler-registry-api/src/main/java/org/apache/dolphinscheduler/registry/api/RegistryClient.java

4
dolphinscheduler-registry/dolphinscheduler-registry-api/src/main/java/org/apache/dolphinscheduler/registry/api/RegistryClient.java

@ -210,11 +210,11 @@ public class RegistryClient {
} }
public boolean isMasterPath(String path) { 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) { 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) { public Collection<String> getChildrenKeys(final String key) {

Loading…
Cancel
Save