Skip to content

Commit

Permalink
normalize default node name
Browse files Browse the repository at this point in the history
  • Loading branch information
rjernst committed Oct 23, 2023
1 parent 2bc748e commit 19be615
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,7 @@ public class ElasticsearchNode implements TestClusterConfiguration {
"is a pre-release version of Elasticsearch",
"max virtual memory areas vm.max_map_count"
);
private static final String HOSTNAME_OVERRIDE = "LinuxDarwinHostname";
private static final String COMPUTERNAME_OVERRIDE = "WindowsComputername";
private static final String HOSTNAME_OVERRIDE = "NodeHostname";

private final String path;
private final String name;
Expand Down Expand Up @@ -907,7 +906,7 @@ private Map<String, String> getESEnvironment() {

// Override the system hostname variables for testing
defaultEnv.put("HOSTNAME", HOSTNAME_OVERRIDE);
defaultEnv.put("COMPUTERNAME", COMPUTERNAME_OVERRIDE);
defaultEnv.put("COMPUTERNAME", HOSTNAME_OVERRIDE);

Set<String> commonKeys = new HashSet<>(environment.keySet());
commonKeys.retainAll(defaultEnv.keySet());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@
nodes.info:
metric: [ settings ]

- match : { nodes.$node_id.settings.node.name: node }
- match : { nodes.$node_id.settings.node.roles: NodeHostname }

- do:
nodes.info:
metric: [ settings ]
flat_settings: true

- match : { nodes.$node_id.settings.node\.name: node }
- match : { nodes.$node_id.settings.node\.name: NodeHostname }

0 comments on commit 19be615

Please sign in to comment.