Stricter parsing of remote node attribute

This commit enables stricter parsing of the remote node attribute,
instead of leniently parsing values that are not "true" as false.
This commit is contained in:
Jason Tedor 2017-04-01 13:18:46 -04:00
parent 38b3fec885
commit 7082baaed9
1 changed files with 1 additions and 1 deletions

View File

@ -138,7 +138,7 @@ public final class RemoteClusterService extends AbstractComponent implements Clo
// nodes can be tagged with node.attr.remote_gateway: true to allow a node to be a gateway node for
// cross cluster search
String attribute = REMOTE_NODE_ATTRIBUTE.get(settings);
nodePredicate = nodePredicate.and((node) -> Booleans.isTrue(node.getAttributes().getOrDefault(attribute, "false")));
nodePredicate = nodePredicate.and((node) -> Booleans.parseBoolean(node.getAttributes().getOrDefault(attribute, "false")));
}
remoteClusters.putAll(this.remoteClusters);
for (Map.Entry<String, List<DiscoveryNode>> entry : seeds.entrySet()) {