Commit a928231
[Data Streams] Fix displayed index mode (elastic#215683)
Fixes elastic#208671
## Summary
Before this PR, the displayed index mode of the data streams was
determined based on the index mode of the associated index template.
However, the index mode can also be set through the component template,
so that logic is not reliable and can cause incorrectly displayed index
mode like described in elastic#208671.
In this PR, we replace this logic with the recently added `index_mode`
field to the Es Get Data Streams API (see
elastic/elasticsearch#122486).
**How to test:**
1. Create a component template with a LogsDB index mode (you can also
test with other index modes):
```
PUT _component_template/my-component-template
{
"template": {
"settings": {
"index": {
"mode": "logsdb"
}
}
}
}
```
2. Create an index template that is composed of the component template
above:
```
PUT _index_template/my-index-template
{
"index_patterns": [
"my-ds-*"
],
"data_stream": {},
"composed_of": [
"my-component-template"
]
}
```
3. Create a data stream that matched the index pattern from the index
template above:
```
PUT _data_stream/my-ds-1
```
4. Go to the data streams table and verify that the index mode is
displayed correctly in the table.
<img width="1165" alt="Screenshot 2025-03-24 at 18 12 04"
src="https://github.com/user-attachments/assets/ea211c14-3d03-49c7-ace7-88b15e294d1f"
/>
5. Click on the created data stream and verify that the displayed index
mode in the details panel is correct:
<img width="1165" alt="Screenshot 2025-03-06 at 14 36 12"
src="https://github.com/user-attachments/assets/954864e2-ae2a-4cb8-9eef-2c5f8b417f52"
/>
---------
Co-authored-by: Elastic Machine <[email protected]>1 parent e7098a3 commit a928231
File tree
3 files changed
+18
-34
lines changed- x-pack
- test_serverless/functional/test_suites/common/management/index_management
- test/functional/apps/index_management/data_streams_tab
3 files changed
+18
-34
lines changedLines changed: 0 additions & 30 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
14 | | - | |
15 | 14 | | |
16 | 15 | | |
17 | 16 | | |
| |||
32 | 31 | | |
33 | 32 | | |
34 | 33 | | |
35 | | - | |
36 | 34 | | |
37 | 35 | | |
38 | 36 | | |
39 | 37 | | |
40 | 38 | | |
41 | 39 | | |
42 | | - | |
43 | 40 | | |
44 | 41 | | |
45 | 42 | | |
| |||
74 | 71 | | |
75 | 72 | | |
76 | 73 | | |
77 | | - | |
78 | | - | |
79 | | - | |
80 | | - | |
81 | | - | |
82 | | - | |
83 | | - | |
84 | | - | |
85 | | - | |
86 | | - | |
87 | 74 | | |
88 | 75 | | |
89 | 76 | | |
| |||
172 | 159 | | |
173 | 160 | | |
174 | 161 | | |
175 | | - | |
176 | | - | |
177 | | - | |
178 | 162 | | |
179 | 163 | | |
180 | 164 | | |
| |||
192 | 176 | | |
193 | 177 | | |
194 | 178 | | |
195 | | - | |
196 | 179 | | |
197 | 180 | | |
198 | 181 | | |
| |||
243 | 226 | | |
244 | 227 | | |
245 | 228 | | |
246 | | - | |
247 | 229 | | |
248 | 230 | | |
249 | 231 | | |
250 | 232 | | |
251 | 233 | | |
252 | | - | |
253 | | - | |
254 | | - | |
255 | | - | |
256 | | - | |
257 | | - | |
258 | | - | |
259 | | - | |
260 | | - | |
261 | | - | |
262 | | - | |
263 | 234 | | |
264 | 235 | | |
265 | 236 | | |
266 | 237 | | |
267 | 238 | | |
268 | 239 | | |
269 | | - | |
270 | 240 | | |
271 | 241 | | |
272 | 242 | | |
| |||
Lines changed: 9 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
287 | 287 | | |
288 | 288 | | |
289 | 289 | | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
290 | 295 | | |
291 | 296 | | |
292 | 297 | | |
| |||
342 | 347 | | |
343 | 348 | | |
344 | 349 | | |
345 | | - | |
| 350 | + | |
| 351 | + | |
346 | 352 | | |
347 | 353 | | |
348 | 354 | | |
| |||
364 | 370 | | |
365 | 371 | | |
366 | 372 | | |
367 | | - | |
| 373 | + | |
| 374 | + | |
368 | 375 | | |
369 | 376 | | |
370 | 377 | | |
| |||
Lines changed: 9 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
205 | 205 | | |
206 | 206 | | |
207 | 207 | | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
208 | 213 | | |
209 | 214 | | |
210 | 215 | | |
| |||
267 | 272 | | |
268 | 273 | | |
269 | 274 | | |
270 | | - | |
| 275 | + | |
| 276 | + | |
271 | 277 | | |
272 | 278 | | |
273 | 279 | | |
| |||
288 | 294 | | |
289 | 295 | | |
290 | 296 | | |
291 | | - | |
| 297 | + | |
| 298 | + | |
292 | 299 | | |
293 | 300 | | |
294 | 301 | | |
| |||
0 commit comments