Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove 'cluster_manager' role attachment when using 'node.master' deprecated setting #6331

Merged
merged 12 commits into from
Mar 28, 2023
Prev Previous commit
Next Next commit
Fix role filtering from legacy settings
Signed-off-by: Sandesh Kumar <sandeshkr419@gmail.com>
  • Loading branch information
sandeshkr419 committed Mar 28, 2023
commit 53d9d2e0b6ed555bf767205fe8511b497d7ef87e
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,14 @@ public static Set<DiscoveryNodeRole> getRolesFromSettings(final Settings setting
validateLegacySettings(settings, roleMap);
return Collections.unmodifiableSet(new HashSet<>(NODE_ROLES_SETTING.get(settings)));
} else {
return roleMap.values().stream().filter(s -> s.isEnabledByDefault(settings)).collect(Collectors.toSet());
return roleMap.values()
.stream()
.filter(
s -> !s.roleName().equals(DiscoveryNodeRole.CLUSTER_MANAGER_ROLE.roleName())
&& s.legacySetting() != null
&& s.legacySetting().get(settings)
)
.collect(Collectors.toSet());
}
}

Expand Down