@@ -76,7 +76,7 @@ func TestIndexCreateIfNotExist(t *testing.T) {
76
76
77
77
for _ , test := range tests {
78
78
t .Run (test .name , func (t * testing.T ) {
79
- indexClient := & mocks.MockIndexAPI {}
79
+ indexClient := & mocks.IndexAPI {}
80
80
indexClient .On ("CreateIndex" , "jaeger-span" ).Return (test .returnErr )
81
81
err := createIndexIfNotExist (indexClient , "jaeger-span" )
82
82
if test .containsError != "" {
@@ -91,13 +91,13 @@ func TestIndexCreateIfNotExist(t *testing.T) {
91
91
func TestRolloverAction (t * testing.T ) {
92
92
tests := []struct {
93
93
name string
94
- setupCallExpectations func (indexClient * mocks.MockIndexAPI , clusterClient * mocks.MockClusterAPI , ilmClient * mocks.MockILMAPI )
94
+ setupCallExpectations func (indexClient * mocks.IndexAPI , clusterClient * mocks.ClusterAPI , ilmClient * mocks.IndexManagementLifecycleAPI )
95
95
config Config
96
96
expectedErr error
97
97
}{
98
98
{
99
99
name : "Unsupported version" ,
100
- setupCallExpectations : func (_ * mocks.MockIndexAPI , clusterClient * mocks.MockClusterAPI , _ * mocks.MockILMAPI ) {
100
+ setupCallExpectations : func (_ * mocks.IndexAPI , clusterClient * mocks.ClusterAPI , _ * mocks.IndexManagementLifecycleAPI ) {
101
101
clusterClient .On ("Version" ).Return (uint (5 ), nil )
102
102
},
103
103
config : Config {
@@ -110,7 +110,7 @@ func TestRolloverAction(t *testing.T) {
110
110
},
111
111
{
112
112
name : "error getting version" ,
113
- setupCallExpectations : func (_ * mocks.MockIndexAPI , clusterClient * mocks.MockClusterAPI , _ * mocks.MockILMAPI ) {
113
+ setupCallExpectations : func (_ * mocks.IndexAPI , clusterClient * mocks.ClusterAPI , _ * mocks.IndexManagementLifecycleAPI ) {
114
114
clusterClient .On ("Version" ).Return (uint (0 ), errors .New ("version error" ))
115
115
},
116
116
expectedErr : errors .New ("version error" ),
@@ -123,7 +123,7 @@ func TestRolloverAction(t *testing.T) {
123
123
},
124
124
{
125
125
name : "ilm doesnt exist" ,
126
- setupCallExpectations : func (_ * mocks.MockIndexAPI , clusterClient * mocks.MockClusterAPI , ilmClient * mocks.MockILMAPI ) {
126
+ setupCallExpectations : func (_ * mocks.IndexAPI , clusterClient * mocks.ClusterAPI , ilmClient * mocks.IndexManagementLifecycleAPI ) {
127
127
clusterClient .On ("Version" ).Return (uint (7 ), nil )
128
128
ilmClient .On ("Exists" , "myilmpolicy" ).Return (false , nil )
129
129
},
@@ -138,7 +138,7 @@ func TestRolloverAction(t *testing.T) {
138
138
},
139
139
{
140
140
name : "fail get ilm policy" ,
141
- setupCallExpectations : func (_ * mocks.MockIndexAPI , clusterClient * mocks.MockClusterAPI , ilmClient * mocks.MockILMAPI ) {
141
+ setupCallExpectations : func (_ * mocks.IndexAPI , clusterClient * mocks.ClusterAPI , ilmClient * mocks.IndexManagementLifecycleAPI ) {
142
142
clusterClient .On ("Version" ).Return (uint (7 ), nil )
143
143
ilmClient .On ("Exists" , "myilmpolicy" ).Return (false , errors .New ("error getting ilm policy" ))
144
144
},
@@ -153,7 +153,7 @@ func TestRolloverAction(t *testing.T) {
153
153
},
154
154
{
155
155
name : "fail to create template" ,
156
- setupCallExpectations : func (indexClient * mocks.MockIndexAPI , clusterClient * mocks.MockClusterAPI , _ * mocks.MockILMAPI ) {
156
+ setupCallExpectations : func (indexClient * mocks.IndexAPI , clusterClient * mocks.ClusterAPI , _ * mocks.IndexManagementLifecycleAPI ) {
157
157
clusterClient .On ("Version" ).Return (uint (7 ), nil )
158
158
indexClient .On ("CreateTemplate" , mock .Anything , "jaeger-span" ).Return (errors .New ("error creating template" ))
159
159
},
@@ -167,7 +167,7 @@ func TestRolloverAction(t *testing.T) {
167
167
},
168
168
{
169
169
name : "fail to get jaeger indices" ,
170
- setupCallExpectations : func (indexClient * mocks.MockIndexAPI , clusterClient * mocks.MockClusterAPI , _ * mocks.MockILMAPI ) {
170
+ setupCallExpectations : func (indexClient * mocks.IndexAPI , clusterClient * mocks.ClusterAPI , _ * mocks.IndexManagementLifecycleAPI ) {
171
171
clusterClient .On ("Version" ).Return (uint (7 ), nil )
172
172
indexClient .On ("CreateTemplate" , mock .Anything , "jaeger-span" ).Return (nil )
173
173
indexClient .On ("CreateIndex" , "jaeger-span-archive-000001" ).Return (nil )
@@ -183,7 +183,7 @@ func TestRolloverAction(t *testing.T) {
183
183
},
184
184
{
185
185
name : "fail to create alias" ,
186
- setupCallExpectations : func (indexClient * mocks.MockIndexAPI , clusterClient * mocks.MockClusterAPI , _ * mocks.MockILMAPI ) {
186
+ setupCallExpectations : func (indexClient * mocks.IndexAPI , clusterClient * mocks.ClusterAPI , _ * mocks.IndexManagementLifecycleAPI ) {
187
187
clusterClient .On ("Version" ).Return (uint (7 ), nil )
188
188
indexClient .On ("CreateTemplate" , mock .Anything , "jaeger-span" ).Return (nil )
189
189
indexClient .On ("CreateIndex" , "jaeger-span-archive-000001" ).Return (nil )
@@ -203,7 +203,7 @@ func TestRolloverAction(t *testing.T) {
203
203
},
204
204
{
205
205
name : "create rollover index" ,
206
- setupCallExpectations : func (indexClient * mocks.MockIndexAPI , clusterClient * mocks.MockClusterAPI , _ * mocks.MockILMAPI ) {
206
+ setupCallExpectations : func (indexClient * mocks.IndexAPI , clusterClient * mocks.ClusterAPI , _ * mocks.IndexManagementLifecycleAPI ) {
207
207
clusterClient .On ("Version" ).Return (uint (7 ), nil )
208
208
indexClient .On ("CreateTemplate" , mock .Anything , "jaeger-span" ).Return (nil )
209
209
indexClient .On ("CreateIndex" , "jaeger-span-archive-000001" ).Return (nil )
@@ -223,7 +223,7 @@ func TestRolloverAction(t *testing.T) {
223
223
},
224
224
{
225
225
name : "create rollover index with ilm" ,
226
- setupCallExpectations : func (indexClient * mocks.MockIndexAPI , clusterClient * mocks.MockClusterAPI , ilmClient * mocks.MockILMAPI ) {
226
+ setupCallExpectations : func (indexClient * mocks.IndexAPI , clusterClient * mocks.ClusterAPI , ilmClient * mocks.IndexManagementLifecycleAPI ) {
227
227
clusterClient .On ("Version" ).Return (uint (7 ), nil )
228
228
indexClient .On ("CreateTemplate" , mock .Anything , "jaeger-span" ).Return (nil )
229
229
indexClient .On ("CreateIndex" , "jaeger-span-archive-000001" ).Return (nil )
@@ -247,9 +247,9 @@ func TestRolloverAction(t *testing.T) {
247
247
248
248
for _ , test := range tests {
249
249
t .Run (test .name , func (t * testing.T ) {
250
- indexClient := & mocks.MockIndexAPI {}
251
- clusterClient := & mocks.MockClusterAPI {}
252
- ilmClient := & mocks.MockILMAPI {}
250
+ indexClient := & mocks.IndexAPI {}
251
+ clusterClient := & mocks.ClusterAPI {}
252
+ ilmClient := & mocks.IndexManagementLifecycleAPI {}
253
253
initAction := Action {
254
254
Config : test .config ,
255
255
IndicesClient : indexClient ,
0 commit comments