@@ -196,20 +196,20 @@ func TestOperator_syncFailingStatus(t *testing.T) {
196
196
}
197
197
}
198
198
199
- type fakeRriFlags struct {
200
- unknownVersion bool
201
- resourceReconciliationIssuesCondition bool
199
+ type fakeRiFlags struct {
200
+ unknownVersion bool
201
+ reconciliationIssuesCondition bool
202
202
}
203
203
204
- func (f fakeRriFlags ) UnknownVersion () bool {
204
+ func (f fakeRiFlags ) UnknownVersion () bool {
205
205
return f .unknownVersion
206
206
}
207
207
208
- func (f fakeRriFlags ) ResourceReconciliationIssuesCondition () bool {
209
- return f .resourceReconciliationIssuesCondition
208
+ func (f fakeRiFlags ) ReconciliationIssuesCondition () bool {
209
+ return f .reconciliationIssuesCondition
210
210
}
211
211
212
- func TestUpdateClusterVersionStatus_UnknownVersionAndRRI (t * testing.T ) {
212
+ func TestUpdateClusterVersionStatus_UnknownVersionAndReconciliationIssues (t * testing.T ) {
213
213
ignoreLastTransitionTime := cmpopts .IgnoreFields (configv1.ClusterOperatorStatusCondition {}, "LastTransitionTime" )
214
214
215
215
testCases := []struct {
@@ -219,49 +219,49 @@ func TestUpdateClusterVersionStatus_UnknownVersionAndRRI(t *testing.T) {
219
219
oldCondition * configv1.ClusterOperatorStatusCondition
220
220
failure error
221
221
222
- expectedRriCondition * configv1.ClusterOperatorStatusCondition
222
+ expectedRiCondition * configv1.ClusterOperatorStatusCondition
223
223
}{
224
224
{
225
- name : "RRI disabled, version known, no failure => condition not present" ,
226
- unknownVersion : false ,
227
- expectedRriCondition : nil ,
225
+ name : "ReconciliationIssues disabled, version known, no failure => condition not present" ,
226
+ unknownVersion : false ,
227
+ expectedRiCondition : nil ,
228
228
},
229
229
{
230
- name : "RRI disabled, version known, failure => condition not present" ,
231
- unknownVersion : false ,
232
- failure : fmt .Errorf ("Something happened" ),
233
- expectedRriCondition : nil ,
230
+ name : "ReconciliationIssues disabled, version known, failure => condition not present" ,
231
+ unknownVersion : false ,
232
+ failure : fmt .Errorf ("Something happened" ),
233
+ expectedRiCondition : nil ,
234
234
},
235
235
{
236
- name : "RRI disabled, version unknown, failure, existing condition => condition present" ,
236
+ name : "ReconciliationIssues disabled, version unknown, failure, existing condition => condition present" ,
237
237
oldCondition : & configv1.ClusterOperatorStatusCondition {
238
- Type : resourceReconciliationIssuesConditionType ,
238
+ Type : reconciliationIssuesConditionType ,
239
239
Status : configv1 .ConditionFalse ,
240
- Reason : noResourceReconciliationIssuesReason ,
240
+ Reason : noReconciliationIssuesReason ,
241
241
Message : "Happy condition is happy" ,
242
242
},
243
243
unknownVersion : true ,
244
244
failure : fmt .Errorf ("Something happened" ),
245
- expectedRriCondition : & configv1.ClusterOperatorStatusCondition {
246
- Type : resourceReconciliationIssuesConditionType ,
245
+ expectedRiCondition : & configv1.ClusterOperatorStatusCondition {
246
+ Type : reconciliationIssuesConditionType ,
247
247
Status : configv1 .ConditionTrue ,
248
- Reason : resourceReconciliationIssuesFoundReason ,
249
- Message : "Issues found during resource reconciliation: Something happened" ,
248
+ Reason : reconciliationIssuesFoundReason ,
249
+ Message : "Issues found during reconciliation: Something happened" ,
250
250
},
251
251
},
252
252
{
253
- name : "RRI disabled, version unknown, failure, no existing condition => condition not present" ,
254
- unknownVersion : true ,
255
- failure : fmt .Errorf ("Something happened" ),
256
- expectedRriCondition : nil ,
253
+ name : "ReconciliationIssues disabled, version unknown, failure, no existing condition => condition not present" ,
254
+ unknownVersion : true ,
255
+ failure : fmt .Errorf ("Something happened" ),
256
+ expectedRiCondition : nil ,
257
257
},
258
258
}
259
259
for _ , tc := range testCases {
260
260
tc := tc
261
261
t .Run (tc .name , func (t * testing.T ) {
262
- gates := fakeRriFlags {
263
- unknownVersion : tc .unknownVersion ,
264
- resourceReconciliationIssuesCondition : false ,
262
+ gates := fakeRiFlags {
263
+ unknownVersion : tc .unknownVersion ,
264
+ reconciliationIssuesCondition : false ,
265
265
}
266
266
release := configv1.Release {}
267
267
getAvailableUpdates := func () * availableUpdates { return nil }
@@ -271,8 +271,8 @@ func TestUpdateClusterVersionStatus_UnknownVersionAndRRI(t *testing.T) {
271
271
cvStatus .Conditions = append (cvStatus .Conditions , * tc .oldCondition )
272
272
}
273
273
updateClusterVersionStatus (& cvStatus , & SyncWorkerStatus {Failure : tc .failure }, release , getAvailableUpdates , gates , noErrors )
274
- condition := resourcemerge .FindOperatorStatusCondition (cvStatus .Conditions , resourceReconciliationIssuesConditionType )
275
- if diff := cmp .Diff (tc .expectedRriCondition , condition , ignoreLastTransitionTime ); diff != "" {
274
+ condition := resourcemerge .FindOperatorStatusCondition (cvStatus .Conditions , reconciliationIssuesConditionType )
275
+ if diff := cmp .Diff (tc .expectedRiCondition , condition , ignoreLastTransitionTime ); diff != "" {
276
276
t .Errorf ("unexpected condition\n :%s" , diff )
277
277
}
278
278
})
@@ -281,7 +281,7 @@ func TestUpdateClusterVersionStatus_UnknownVersionAndRRI(t *testing.T) {
281
281
282
282
}
283
283
284
- func TestUpdateClusterVersionStatus_ResourceReconciliationIssues (t * testing.T ) {
284
+ func TestUpdateClusterVersionStatus_ReconciliationIssues (t * testing.T ) {
285
285
ignoreLastTransitionTime := cmpopts .IgnoreFields (configv1.ClusterOperatorStatusCondition {}, "LastTransitionTime" )
286
286
287
287
testCases := []struct {
@@ -293,31 +293,31 @@ func TestUpdateClusterVersionStatus_ResourceReconciliationIssues(t *testing.T) {
293
293
expectedCondition * configv1.ClusterOperatorStatusCondition
294
294
}{
295
295
{
296
- name : "ResourceReconciliationIssues present and happy when gate is enabled and no failures happened" ,
296
+ name : "ReconciliationIssues present and happy when gate is enabled and no failures happened" ,
297
297
syncWorkerStatus : SyncWorkerStatus {},
298
298
enabled : true ,
299
299
expectedCondition : & configv1.ClusterOperatorStatusCondition {
300
- Type : resourceReconciliationIssuesConditionType ,
300
+ Type : reconciliationIssuesConditionType ,
301
301
Status : configv1 .ConditionFalse ,
302
- Reason : noResourceReconciliationIssuesReason ,
303
- Message : noResourceReconciliationIssuesMessage ,
302
+ Reason : noReconciliationIssuesReason ,
303
+ Message : noReconciliationIssuesMessage ,
304
304
},
305
305
},
306
306
{
307
- name : "ResourceReconciliationIssues present and unhappy when gate is enabled and failures happened" ,
307
+ name : "ReconciliationIssues present and unhappy when gate is enabled and failures happened" ,
308
308
syncWorkerStatus : SyncWorkerStatus {
309
309
Failure : fmt .Errorf ("Something happened" ),
310
310
},
311
311
enabled : true ,
312
312
expectedCondition : & configv1.ClusterOperatorStatusCondition {
313
- Type : resourceReconciliationIssuesConditionType ,
313
+ Type : reconciliationIssuesConditionType ,
314
314
Status : configv1 .ConditionTrue ,
315
- Reason : resourceReconciliationIssuesFoundReason ,
316
- Message : "Issues found during resource reconciliation: Something happened" ,
315
+ Reason : reconciliationIssuesFoundReason ,
316
+ Message : "Issues found during reconciliation: Something happened" ,
317
317
},
318
318
},
319
319
{
320
- name : "ResourceReconciliationIssues not present when gate is enabled and failures happened" ,
320
+ name : "ReconciliationIssues not present when gate is enabled and failures happened" ,
321
321
syncWorkerStatus : SyncWorkerStatus {
322
322
Failure : fmt .Errorf ("Something happened" ),
323
323
},
@@ -329,16 +329,16 @@ func TestUpdateClusterVersionStatus_ResourceReconciliationIssues(t *testing.T) {
329
329
for _ , tc := range testCases {
330
330
tc := tc
331
331
t .Run (tc .name , func (t * testing.T ) {
332
- gates := fakeRriFlags {
333
- unknownVersion : false ,
334
- resourceReconciliationIssuesCondition : tc .enabled ,
332
+ gates := fakeRiFlags {
333
+ unknownVersion : false ,
334
+ reconciliationIssuesCondition : tc .enabled ,
335
335
}
336
336
release := configv1.Release {}
337
337
getAvailableUpdates := func () * availableUpdates { return nil }
338
338
var noErrors field.ErrorList
339
339
cvStatus := configv1.ClusterVersionStatus {}
340
340
updateClusterVersionStatus (& cvStatus , & tc .syncWorkerStatus , release , getAvailableUpdates , gates , noErrors )
341
- condition := resourcemerge .FindOperatorStatusCondition (cvStatus .Conditions , resourceReconciliationIssuesConditionType )
341
+ condition := resourcemerge .FindOperatorStatusCondition (cvStatus .Conditions , reconciliationIssuesConditionType )
342
342
if diff := cmp .Diff (tc .expectedCondition , condition , ignoreLastTransitionTime ); diff != "" {
343
343
t .Errorf ("unexpected condition\n :%s" , diff )
344
344
}
0 commit comments