Skip to content

Commit c55bdea

Browse files
committed
test: use correct informer to process featuregate
Bad naming got me here. I used the CV-specific informer factory instead of the generic one, resulting in tests always seeing the default featureset because of the `IsNotFound` branch after the GET.
1 parent cb32cb8 commit c55bdea

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

pkg/start/start_integration_test.go

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -189,12 +189,12 @@ func TestIntegrationCVO_initializeAndUpgrade(t *testing.T) {
189189
t.Fatalf("incorrectly initialized options: %v", err)
190190
}
191191

192-
cvif, cif := options.prepareConfigInformerFactories(cb)
193-
featureset, gates, err := options.processInitialFeatureGate(context.Background(), cvif)
192+
clusterVersionConfigInformerFactory, configInformerFactory := options.prepareConfigInformerFactories(cb)
193+
featureset, gates, err := options.processInitialFeatureGate(context.Background(), configInformerFactory)
194194
if err != nil {
195195
t.Fatal(err)
196196
}
197-
controllers, err := options.NewControllerContext(cb, featureset, gates, cvif, cif)
197+
controllers, err := options.NewControllerContext(cb, featureset, gates, clusterVersionConfigInformerFactory, configInformerFactory)
198198
if err != nil {
199199
t.Fatal(err)
200200
}
@@ -330,12 +330,12 @@ func TestIntegrationCVO_gracefulStepDown(t *testing.T) {
330330
t.Fatalf("incorrectly initialized options: %v", err)
331331
}
332332

333-
cvif, cif := options.prepareConfigInformerFactories(cb)
334-
featureset, gates, err := options.processInitialFeatureGate(context.Background(), cvif)
333+
clusterVersionConfigInformerFactory, configInformerFactory := options.prepareConfigInformerFactories(cb)
334+
featureset, gates, err := options.processInitialFeatureGate(context.Background(), configInformerFactory)
335335
if err != nil {
336336
t.Fatal(err)
337337
}
338-
controllers, err := options.NewControllerContext(cb, featureset, gates, cvif, cif)
338+
controllers, err := options.NewControllerContext(cb, featureset, gates, clusterVersionConfigInformerFactory, configInformerFactory)
339339
if err != nil {
340340
t.Fatal(err)
341341
}
@@ -533,12 +533,12 @@ metadata:
533533
t.Fatalf("incorrectly initialized options: %v", err)
534534
}
535535

536-
cvif, cif := options.prepareConfigInformerFactories(cb)
537-
featureset, gates, err := options.processInitialFeatureGate(context.Background(), cvif)
536+
clusterVersionConfigInformerFactory, configInformerFactory := options.prepareConfigInformerFactories(cb)
537+
featureset, gates, err := options.processInitialFeatureGate(context.Background(), configInformerFactory)
538538
if err != nil {
539539
t.Fatal(err)
540540
}
541-
controllers, err := options.NewControllerContext(cb, featureset, gates, cvif, cif)
541+
controllers, err := options.NewControllerContext(cb, featureset, gates, clusterVersionConfigInformerFactory, configInformerFactory)
542542
if err != nil {
543543
t.Fatal(err)
544544
}

0 commit comments

Comments
 (0)