@@ -184,15 +184,16 @@ func TestIntegrationCVO_initializeAndUpgrade(t *testing.T) {
184
184
options .ReleaseImage = payloadImage1
185
185
options .PayloadOverride = filepath .Join (dir , "0.0.1" )
186
186
options .leaderElection = getLeaderElectionConfig (ctx , cfg )
187
- alwaysEnableCapabilities := []configv1.ClusterVersionCapability {
188
- configv1 .ClusterVersionCapabilityIngress ,
187
+ options .AlwaysEnableCapabilities = []string {string (configv1 .ClusterVersionCapabilityIngress )}
188
+ if err := options .ValidateAndComplete (); err != nil {
189
+ t .Fatalf ("incorrectly initialized options: %v" , err )
189
190
}
190
- controllers , err := options .NewControllerContext (cb , alwaysEnableCapabilities )
191
+ controllers , err := options .NewControllerContext (cb )
191
192
if err != nil {
192
193
t .Fatal (err )
193
194
}
194
195
195
- worker := cvo .NewSyncWorker (retriever , cvo .NewResourceBuilder (cfg , cfg , nil , nil ), 5 * time .Second , wait.Backoff {Steps : 3 }, "" , "" , record .NewFakeRecorder (100 ), payload .DefaultClusterProfile , alwaysEnableCapabilities )
196
+ worker := cvo .NewSyncWorker (retriever , cvo .NewResourceBuilder (cfg , cfg , nil , nil ), 5 * time .Second , wait.Backoff {Steps : 3 }, "" , "" , record .NewFakeRecorder (100 ), payload .DefaultClusterProfile , stringsToCapabilities ( options . AlwaysEnableCapabilities ) )
196
197
controllers .CVO .SetSyncWorkerForTesting (worker )
197
198
198
199
lock , err := createResourceLock (cb , options .Namespace , options .Name )
@@ -318,15 +319,16 @@ func TestIntegrationCVO_gracefulStepDown(t *testing.T) {
318
319
options .ReleaseImage = payloadImage1
319
320
options .PayloadOverride = filepath .Join (dir , "0.0.1" )
320
321
options .leaderElection = getLeaderElectionConfig (ctx , cfg )
321
- alwaysEnableCapabilities := []configv1.ClusterVersionCapability {
322
- configv1 .ClusterVersionCapabilityIngress ,
322
+ options .AlwaysEnableCapabilities = []string {string (configv1 .ClusterVersionCapabilityIngress )}
323
+ if err := options .ValidateAndComplete (); err != nil {
324
+ t .Fatalf ("incorrectly initialized options: %v" , err )
323
325
}
324
- controllers , err := options .NewControllerContext (cb , alwaysEnableCapabilities )
326
+ controllers , err := options .NewControllerContext (cb )
325
327
if err != nil {
326
328
t .Fatal (err )
327
329
}
328
330
329
- worker := cvo .NewSyncWorker (retriever , cvo .NewResourceBuilder (cfg , cfg , nil , nil ), 5 * time .Second , wait.Backoff {Steps : 3 }, "" , "" , record .NewFakeRecorder (100 ), payload .DefaultClusterProfile , alwaysEnableCapabilities )
331
+ worker := cvo .NewSyncWorker (retriever , cvo .NewResourceBuilder (cfg , cfg , nil , nil ), 5 * time .Second , wait.Backoff {Steps : 3 }, "" , "" , record .NewFakeRecorder (100 ), payload .DefaultClusterProfile , stringsToCapabilities ( options . AlwaysEnableCapabilities ) )
330
332
controllers .CVO .SetSyncWorkerForTesting (worker )
331
333
332
334
lock , err := createResourceLock (cb , options .Namespace , options .Name )
@@ -514,15 +516,16 @@ metadata:
514
516
options .ReleaseImage = payloadImage1
515
517
options .PayloadOverride = payloadDir
516
518
options .leaderElection = getLeaderElectionConfig (ctx , cfg )
517
- alwaysEnableCapabilities := []configv1.ClusterVersionCapability {
518
- configv1 .ClusterVersionCapabilityIngress ,
519
+ options .AlwaysEnableCapabilities = []string {string (configv1 .ClusterVersionCapabilityIngress )}
520
+ if err := options .ValidateAndComplete (); err != nil {
521
+ t .Fatalf ("incorrectly initialized options: %v" , err )
519
522
}
520
- controllers , err := options .NewControllerContext (cb , alwaysEnableCapabilities )
523
+ controllers , err := options .NewControllerContext (cb )
521
524
if err != nil {
522
525
t .Fatal (err )
523
526
}
524
527
525
- worker := cvo .NewSyncWorker (retriever , cvo .NewResourceBuilder (cfg , cfg , nil , nil ), 5 * time .Second , wait.Backoff {Steps : 3 }, "" , "" , record .NewFakeRecorder (100 ), payload .DefaultClusterProfile , alwaysEnableCapabilities )
528
+ worker := cvo .NewSyncWorker (retriever , cvo .NewResourceBuilder (cfg , cfg , nil , nil ), 5 * time .Second , wait.Backoff {Steps : 3 }, "" , "" , record .NewFakeRecorder (100 ), payload .DefaultClusterProfile , stringsToCapabilities ( options . AlwaysEnableCapabilities ) )
526
529
controllers .CVO .SetSyncWorkerForTesting (worker )
527
530
528
531
lock , err := createResourceLock (cb , options .Namespace , options .Name )
0 commit comments