Skip to content

Commit

Permalink
Fix role filtering from legacy settings
Browse files Browse the repository at this point in the history
Signed-off-by: Sandesh Kumar <sandeshkr419@gmail.com>
  • Loading branch information
sandeshkr419 committed Mar 24, 2023
1 parent dcddbf6 commit 306e6a9
Showing 1 changed file with 8 additions and 1 deletion.
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

0 comments on commit 306e6a9

Please sign in to comment.