Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ else if (fieldName != null) { // it's an unknown object that needs to be skipped
realAttributes.put(entry.getKey(), singletonList(entry.getValue()));
}

if (version.startsWith("2.")) {
if (version != null && version.startsWith("2.")) {
/*
* 2.x doesn't send roles, instead we try to read them from
* attributes.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,14 @@ public void test7x() throws IOException {
);
}

@Test
public void testNoVersion() throws IOException {
checkFile(
"no_version_nodes_http.json",
node(9200, "m1", null, "master", "ingest")
);
}

@Test
public void testParsingPublishAddressWithPreES7Format() throws IOException {
InputStream in = this.getClass().getResourceAsStream("es6_nodes_publication_address_format.json");
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{
"_nodes": {
"total": 1,
"successful": 1,
"failed": 0
},
"cluster_name": "elasticsearch",
"nodes": {
"ikXK_skVTfWkhONhldnbkw": {
"name": "m1",
"transport_address": "127.0.0.1:9300",
"host": "127.0.0.1",
"ip": "127.0.0.1",
"build_hash": "8f0685b",
"roles": [
"master",
"ingest"
],
"attributes": {
"dummy": "everyone_has_me",
"number": "1",
"array.0": "m",
"array.1": "1"
},
"http": {
"bound_address": [
"[::1]:9200",
"127.0.0.1:9200"
],
"publish_address": "127.0.0.1:9200",
"max_content_length_in_bytes": 104857600
}
}
}
}
Loading