Commit 6949c2f
committed
Fix cat APIs compatibility with OpenSearch 3.2.0+
OpenSearch 3.2.0 introduced new fields in the cat APIs (indices, nodes, shards)
that were being dropped during JSON marshalling/unmarshalling. This resulted in
test failures when comparing raw JSON with parsed JSON.
Added missing fields to CatIndexResp, CatNodesItemResp, and CatShardResp structs:
- LastIndexRequestTimestamp and LastIndexRequestTimestampString in indices API
- SearchStartreeQueryCurrent, SearchStartreeQueryTime, SearchStartreeQueryTotal in search stats
- PrimaryStartreeQueryCurrent, PrimaryStartreeQueryTime, PrimaryStartreeQueryTotal in primary search stats (indices only)
These fields are always present in OpenSearch 3.2.0+ cat API responses and should be
preserved without omitempty tags since they contain legitimate zero values.
This complements the similar fixes made to the nodes stats and indices stats APIs
and ensures full cat API compatibility with OpenSearch 3.2.0+.
Signed-off-by: Sean Chittenden <sean.chittenden@crowdstrike.com>1 parent 271bc86 commit 6949c2f
4 files changed
Lines changed: 15 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| 20 | + | |
20 | 21 | | |
21 | 22 | | |
22 | 23 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
156 | 156 | | |
157 | 157 | | |
158 | 158 | | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
159 | 165 | | |
160 | 166 | | |
161 | 167 | | |
| |||
193 | 199 | | |
194 | 200 | | |
195 | 201 | | |
| 202 | + | |
| 203 | + | |
196 | 204 | | |
197 | 205 | | |
198 | 206 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
122 | 122 | | |
123 | 123 | | |
124 | 124 | | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
125 | 128 | | |
126 | 129 | | |
127 | 130 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
106 | 106 | | |
107 | 107 | | |
108 | 108 | | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
109 | 112 | | |
110 | 113 | | |
111 | 114 | | |
| |||
0 commit comments