Skip to content

Commit 13c46a8

Browse files
committed
skip cluster_uuid check for earlier versions until it is backported
1 parent 8fe54b0 commit 13c46a8

File tree

4 files changed

+34
-16
lines changed

4 files changed

+34
-16
lines changed

rest-api-spec/src/main/resources/rest-api-spec/test/cluster.state/10_basic.yml

+15-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
- do:
44
cluster.state: {}
55

6-
- is_true: cluster_uuid
76
- is_true: master_node
87

98
---
@@ -16,7 +15,21 @@
1615
cluster.state:
1716
human: true
1817

19-
- is_true: cluster_uuid
2018
- is_true: master_node
2119
- gte: { compressed_size_in_bytes: 50 }
2220
- is_true: compressed_size
21+
22+
---
23+
"get cluster state returns cluster_uuid at the top level":
24+
- skip:
25+
version: " - 6.99.99"
26+
reason: "cluster state including cluster_uuid at the top level is new in v6.4.0 and higher"
27+
28+
- do:
29+
cluster.state:
30+
human: true
31+
32+
- is_true: cluster_uuid
33+
- is_true: master_node
34+
- gte: { compressed_size_in_bytes: 50 }
35+
- is_true: compressed_size

rest-api-spec/src/main/resources/rest-api-spec/test/cluster.state/20_filtering.yml

+16-9
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ setup:
1313
cluster.state:
1414
metric: [ blocks ]
1515

16-
- is_true: cluster_uuid
1716
- is_true: blocks
1817
- is_false: nodes
1918
- is_false: metadata
@@ -32,7 +31,6 @@ setup:
3231
cluster.state:
3332
metric: [ blocks ]
3433

35-
- is_true: cluster_uuid
3634
- is_true: blocks
3735
- is_false: nodes
3836
- is_false: metadata
@@ -52,7 +50,6 @@ setup:
5250
cluster.state:
5351
metric: [ nodes ]
5452

55-
- is_true: cluster_uuid
5653
- is_false: blocks
5754
- is_true: nodes
5855
- is_false: metadata
@@ -65,7 +62,6 @@ setup:
6562
cluster.state:
6663
metric: [ metadata ]
6764

68-
- is_true: cluster_uuid
6965
- is_false: blocks
7066
- is_false: nodes
7167
- is_true: metadata
@@ -79,7 +75,6 @@ setup:
7975
cluster.state:
8076
metric: [ routing_table ]
8177

82-
- is_true: cluster_uuid
8378
- is_false: blocks
8479
- is_false: nodes
8580
- is_false: metadata
@@ -92,7 +87,6 @@ setup:
9287
cluster.state:
9388
metric: [ routing_nodes ]
9489

95-
- is_true: cluster_uuid
9690
- is_false: blocks
9791
- is_false: nodes
9892
- is_false: metadata
@@ -114,7 +108,6 @@ setup:
114108
metric: [ routing_table, metadata ]
115109
index: [ testidx ]
116110

117-
- is_true: cluster_uuid
118111
- is_false: metadata.indices.another
119112
- is_false: routing_table.indices.another
120113
- is_true: metadata.indices.testidx
@@ -127,7 +120,6 @@ setup:
127120
metric: [ '_all' ]
128121
index: [ '_all' ]
129122

130-
- is_true: cluster_uuid
131123
- is_true: blocks
132124
- is_true: nodes
133125
- is_true: metadata
@@ -160,8 +152,23 @@ setup:
160152
- is_false: metadata.indices.testidx
161153
- is_false: routing_table.indices.testidx
162154

163-
- is_true: cluster_uuid
164155
- is_true: metadata.indices.index1
165156
- is_true: routing_table.indices.index1
166157
- is_true: metadata.indices.index2
167158
- is_true: routing_table.indices.index2
159+
160+
---
161+
"Filtering the cluster state returns cluster_uuid at the top level regardless of metric filters":
162+
- skip:
163+
version: " - 6.99.99"
164+
reason: "cluster state including cluster_uuid at the top level is new in v6.4.0 and higher"
165+
166+
- do:
167+
cluster.state:
168+
metric: [ master_node, version, metadata ]
169+
170+
- is_true: cluster_uuid
171+
- is_true: master_node
172+
- is_true: version
173+
- is_true: state_uuid
174+
- is_true: metadata

rest-api-spec/src/main/resources/rest-api-spec/test/cluster.state/30_expand_wildcards.yml

-5
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ setup:
3535
index: test*
3636
expand_wildcards: [ closed ]
3737

38-
- is_true: cluster_uuid
3938
- is_false: metadata.indices.test_open_index
4039
- match: {metadata.indices.test_close_index.state: "close"}
4140

@@ -45,7 +44,6 @@ setup:
4544
index: test*
4645
expand_wildcards: [ open ]
4746

48-
- is_true: cluster_uuid
4947
- match: {metadata.indices.test_open_index.state: "open"}
5048
- is_false: metadata.indices.test_close_index
5149

@@ -55,7 +53,6 @@ setup:
5553
index: test*
5654
expand_wildcards: [ open,closed ]
5755

58-
- is_true: cluster_uuid
5956
- match: {metadata.indices.test_open_index.state: "open"}
6057
- match: {metadata.indices.test_close_index.state: "close"}
6158

@@ -68,7 +65,6 @@ setup:
6865
index: foobla
6966
ignore_unavailable: true
7067

71-
- is_true: cluster_uuid
7268
- match: {metadata.indices: {}}
7369

7470
- do:
@@ -86,7 +82,6 @@ setup:
8682
metric: [ metadata ]
8783
index: not_there*
8884

89-
- is_true: cluster_uuid
9085
- match: {metadata.indices: {}}
9186

9287
- do:

server/src/test/java/org/elasticsearch/action/admin/cluster/reroute/ClusterRerouteResponseTests.java

+3
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ public void testToXContent() throws IOException {
6969
assertEquals("{\n" +
7070
" \"acknowledged\" : true,\n" +
7171
" \"state\" : {\n" +
72+
" \"cluster_uuid\" : \"_na_\",\n" +
7273
" \"version\" : 0,\n" +
7374
" \"state_uuid\" : \"" + clusterState.stateUUID() + "\",\n" +
7475
" \"master_node\" : \"node0\",\n" +
@@ -136,6 +137,7 @@ public void testToXContent() throws IOException {
136137
assertEquals("{\n" +
137138
" \"acknowledged\" : true,\n" +
138139
" \"state\" : {\n" +
140+
" \"cluster_uuid\" : \"_na_\",\n" +
139141
" \"version\" : 0,\n" +
140142
" \"state_uuid\" : \"" + clusterState.stateUUID() + "\",\n" +
141143
" \"master_node\" : \"node0\"\n" +
@@ -168,6 +170,7 @@ public void testToXContent() throws IOException {
168170
assertEquals("{\n" +
169171
" \"acknowledged\" : true,\n" +
170172
" \"state\" : {\n" +
173+
" \"cluster_uuid\" : \"_na_\",\n" +
171174
" \"metadata\" : {\n" +
172175
" \"cluster_uuid\" : \"_na_\",\n" +
173176
" \"templates\" : { },\n" +

0 commit comments

Comments
 (0)