Skip to content

Commit 648c3a1

Browse files
committed
Rename consolidateFields to consolidateV320StatsFields for clarity
Signed-off-by: Sean Chittenden <sean.chittenden@crowdstrike.com>
1 parent c116520 commit 648c3a1

2 files changed

Lines changed: 7 additions & 7 deletions

File tree

opensearchapi/api_cat-indices_consolidation_test.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ func TestCatIndicesConsolidateFields(t *testing.T) {
3232
}
3333

3434
// Call consolidateFields method
35-
resp.consolidateFields()
35+
resp.consolidateV320StatsFields()
3636

3737
// Stable fields should remain unchanged
3838
assert.Equal(t, 10, *resp.Indices[0].PrimarySearchStartreeQueryCurrent)
@@ -55,7 +55,7 @@ func TestCatIndicesConsolidateFields(t *testing.T) {
5555
},
5656
}
5757

58-
resp.consolidateFields()
58+
resp.consolidateV320StatsFields()
5959

6060
// Should fallback to V32 values when stable fields are nil
6161
assert.Equal(t, 20, *resp.Indices[0].PrimarySearchStartreeQueryCurrent)
@@ -81,7 +81,7 @@ func TestCatIndicesConsolidateFields(t *testing.T) {
8181
},
8282
}
8383

84-
resp.consolidateFields()
84+
resp.consolidateV320StatsFields()
8585

8686
// Stable fields should take precedence
8787
assert.Equal(t, 10, *resp.Indices[0].PrimarySearchStartreeQueryCurrent)
@@ -107,7 +107,7 @@ func TestCatIndicesConsolidateFields(t *testing.T) {
107107
},
108108
}
109109

110-
resp.consolidateFields()
110+
resp.consolidateV320StatsFields()
111111

112112
// Should use V32 values when stable fields have zero/empty values
113113
assert.Equal(t, 20, *resp.Indices[0].PrimarySearchStartreeQueryCurrent)
@@ -138,7 +138,7 @@ func TestCatIndicesConsolidateFields(t *testing.T) {
138138
},
139139
}
140140

141-
resp.consolidateFields()
141+
resp.consolidateV320StatsFields()
142142

143143
// Check first index (stable fields)
144144
assert.Equal(t, 10, *resp.Indices[0].PrimarySearchStartreeQueryCurrent)
@@ -165,7 +165,7 @@ func TestCatIndicesConsolidateFields(t *testing.T) {
165165
}
166166

167167
// Should not panic
168-
resp.consolidateFields()
168+
resp.consolidateV320StatsFields()
169169

170170
// All consolidated fields should remain nil
171171
assert.Nil(t, resp.Indices[0].PrimarySearchStartreeQueryCurrent)

opensearchapi/api_cat.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ func (c catClient) Indices(ctx context.Context, req *CatIndicesReq) (*CatIndices
131131
}
132132

133133
// Consolidate version-specific fields to maintain backward compatibility
134-
data.consolidateFields()
134+
data.consolidateV320StatsFields()
135135

136136
return &data, nil
137137
}

0 commit comments

Comments
 (0)