From 96041e38766d1eb391812150fa15adc806ba2d4c Mon Sep 17 00:00:00 2001 From: Zinway Date: Fri, 1 Sep 2023 15:11:49 +0800 Subject: [PATCH] fix invalid registry path ends with 'master' or 'worker' (#14328) Co-authored-by: Zinway Liu Co-authored-by: Aaron Wang --- .../apache/dolphinscheduler/registry/api/RegistryClient.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dolphinscheduler-registry/dolphinscheduler-registry-api/src/main/java/org/apache/dolphinscheduler/registry/api/RegistryClient.java b/dolphinscheduler-registry/dolphinscheduler-registry-api/src/main/java/org/apache/dolphinscheduler/registry/api/RegistryClient.java index ddd80d94a1..f690b6800f 100644 --- a/dolphinscheduler-registry/dolphinscheduler-registry-api/src/main/java/org/apache/dolphinscheduler/registry/api/RegistryClient.java +++ b/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) { - 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 getChildrenKeys(final String key) {