@@ -39,6 +39,22 @@ const (
39
39
releaseVersion = "0.0.0.test-unit"
40
40
)
41
41
42
+ var (
43
+ enabledFeatureGates = []openshiftv1.FeatureGateAttributes {
44
+ {Name : apifeatures .FeatureGateMachineAPIMigration },
45
+ {Name : apifeatures .FeatureGateVSphereStaticIPs },
46
+ {Name : apifeatures .FeatureGateGCPLabelsTags },
47
+ {Name : apifeatures .FeatureGateAzureWorkloadIdentity },
48
+ }
49
+
50
+ enabledFeatureMap = map [string ]bool {
51
+ "MachineAPIMigration" : true ,
52
+ "GCPLabelsTags" : true ,
53
+ "AzureWorkloadIdentity" : true ,
54
+ "VSphereStaticIPs" : true ,
55
+ }
56
+ )
57
+
42
58
func newFakeOperator (kubeObjects , osObjects , machineObjects []runtime.Object , imagesFile string , fg * openshiftv1.FeatureGate , stopCh <- chan struct {}) (* Operator , error ) {
43
59
kubeClient := fakekube .NewSimpleClientset (kubeObjects ... )
44
60
osClient := fakeos .NewSimpleClientset (osObjects ... )
@@ -61,7 +77,7 @@ func newFakeOperator(kubeObjects, osObjects, machineObjects []runtime.Object, im
61
77
FeatureGates : []openshiftv1.FeatureGateDetails {
62
78
{
63
79
Version : "" ,
64
- Enabled : []openshiftv1. FeatureGateAttributes {{ Name : apifeatures . FeatureGateMachineAPIMigration }} ,
80
+ Enabled : enabledFeatureGates ,
65
81
Disabled : []openshiftv1.FeatureGateAttributes {{Name : apifeatures .FeatureGateMachineAPIOperatorDisableMachineHealthCheckController }},
66
82
},
67
83
},
@@ -360,7 +376,7 @@ func TestMAOConfigFromInfrastructure(t *testing.T) {
360
376
FeatureGates : []openshiftv1.FeatureGateDetails {
361
377
{
362
378
Version : "" ,
363
- Enabled : []openshiftv1. FeatureGateAttributes {{ Name : apifeatures . FeatureGateMachineAPIMigration }} ,
379
+ Enabled : enabledFeatureGates ,
364
380
Disabled : []openshiftv1.FeatureGateAttributes {{Name : apifeatures .FeatureGateMachineAPIOperatorDisableMachineHealthCheckController }},
365
381
},
366
382
},
@@ -379,9 +395,7 @@ func TestMAOConfigFromInfrastructure(t *testing.T) {
379
395
KubeRBACProxy : images .KubeRBACProxy ,
380
396
},
381
397
PlatformType : openshiftv1 .AWSPlatformType ,
382
- Features : map [string ]bool {
383
- "MachineAPIMigration" : true ,
384
- },
398
+ Features : enabledFeatureMap ,
385
399
},
386
400
},
387
401
{
@@ -396,7 +410,7 @@ func TestMAOConfigFromInfrastructure(t *testing.T) {
396
410
FeatureGates : []openshiftv1.FeatureGateDetails {
397
411
{
398
412
Version : "" ,
399
- Enabled : []openshiftv1. FeatureGateAttributes {{ Name : apifeatures . FeatureGateMachineAPIMigration }} ,
413
+ Enabled : enabledFeatureGates ,
400
414
Disabled : []openshiftv1.FeatureGateAttributes {{Name : apifeatures .FeatureGateMachineAPIOperatorDisableMachineHealthCheckController }},
401
415
},
402
416
},
@@ -415,9 +429,7 @@ func TestMAOConfigFromInfrastructure(t *testing.T) {
415
429
KubeRBACProxy : images .KubeRBACProxy ,
416
430
},
417
431
PlatformType : openshiftv1 .LibvirtPlatformType ,
418
- Features : map [string ]bool {
419
- "MachineAPIMigration" : true ,
420
- },
432
+ Features : enabledFeatureMap ,
421
433
},
422
434
},
423
435
{
@@ -432,7 +444,7 @@ func TestMAOConfigFromInfrastructure(t *testing.T) {
432
444
FeatureGates : []openshiftv1.FeatureGateDetails {
433
445
{
434
446
Version : "" ,
435
- Enabled : []openshiftv1. FeatureGateAttributes {{ Name : apifeatures . FeatureGateMachineAPIMigration }} ,
447
+ Enabled : enabledFeatureGates ,
436
448
Disabled : []openshiftv1.FeatureGateAttributes {{Name : apifeatures .FeatureGateMachineAPIOperatorDisableMachineHealthCheckController }},
437
449
},
438
450
},
@@ -451,9 +463,7 @@ func TestMAOConfigFromInfrastructure(t *testing.T) {
451
463
KubeRBACProxy : images .KubeRBACProxy ,
452
464
},
453
465
PlatformType : openshiftv1 .OpenStackPlatformType ,
454
- Features : map [string ]bool {
455
- "MachineAPIMigration" : true ,
456
- },
466
+ Features : enabledFeatureMap ,
457
467
},
458
468
},
459
469
{
@@ -468,7 +478,7 @@ func TestMAOConfigFromInfrastructure(t *testing.T) {
468
478
FeatureGates : []openshiftv1.FeatureGateDetails {
469
479
{
470
480
Version : "" ,
471
- Enabled : []openshiftv1. FeatureGateAttributes {{ Name : apifeatures . FeatureGateMachineAPIMigration }} ,
481
+ Enabled : enabledFeatureGates ,
472
482
Disabled : []openshiftv1.FeatureGateAttributes {{Name : apifeatures .FeatureGateMachineAPIOperatorDisableMachineHealthCheckController }},
473
483
},
474
484
},
@@ -487,9 +497,7 @@ func TestMAOConfigFromInfrastructure(t *testing.T) {
487
497
KubeRBACProxy : images .KubeRBACProxy ,
488
498
},
489
499
PlatformType : openshiftv1 .AzurePlatformType ,
490
- Features : map [string ]bool {
491
- "MachineAPIMigration" : true ,
492
- },
500
+ Features : enabledFeatureMap ,
493
501
},
494
502
},
495
503
{
@@ -504,7 +512,7 @@ func TestMAOConfigFromInfrastructure(t *testing.T) {
504
512
FeatureGates : []openshiftv1.FeatureGateDetails {
505
513
{
506
514
Version : "" ,
507
- Enabled : []openshiftv1. FeatureGateAttributes {{ Name : apifeatures . FeatureGateMachineAPIMigration }} ,
515
+ Enabled : enabledFeatureGates ,
508
516
Disabled : []openshiftv1.FeatureGateAttributes {{Name : apifeatures .FeatureGateMachineAPIOperatorDisableMachineHealthCheckController }},
509
517
},
510
518
},
@@ -523,9 +531,7 @@ func TestMAOConfigFromInfrastructure(t *testing.T) {
523
531
KubeRBACProxy : images .KubeRBACProxy ,
524
532
},
525
533
PlatformType : openshiftv1 .BareMetalPlatformType ,
526
- Features : map [string ]bool {
527
- "MachineAPIMigration" : true ,
528
- },
534
+ Features : enabledFeatureMap ,
529
535
},
530
536
},
531
537
{
@@ -540,7 +546,7 @@ func TestMAOConfigFromInfrastructure(t *testing.T) {
540
546
FeatureGates : []openshiftv1.FeatureGateDetails {
541
547
{
542
548
Version : "" ,
543
- Enabled : []openshiftv1. FeatureGateAttributes {{ Name : apifeatures . FeatureGateMachineAPIMigration }} ,
549
+ Enabled : enabledFeatureGates ,
544
550
Disabled : []openshiftv1.FeatureGateAttributes {{Name : apifeatures .FeatureGateMachineAPIOperatorDisableMachineHealthCheckController }},
545
551
},
546
552
},
@@ -559,9 +565,7 @@ func TestMAOConfigFromInfrastructure(t *testing.T) {
559
565
KubeRBACProxy : images .KubeRBACProxy ,
560
566
},
561
567
PlatformType : openshiftv1 .GCPPlatformType ,
562
- Features : map [string ]bool {
563
- "MachineAPIMigration" : true ,
564
- },
568
+ Features : enabledFeatureMap ,
565
569
},
566
570
},
567
571
{
@@ -576,7 +580,7 @@ func TestMAOConfigFromInfrastructure(t *testing.T) {
576
580
FeatureGates : []openshiftv1.FeatureGateDetails {
577
581
{
578
582
Version : "" ,
579
- Enabled : []openshiftv1. FeatureGateAttributes {{ Name : apifeatures . FeatureGateMachineAPIMigration }} ,
583
+ Enabled : enabledFeatureGates ,
580
584
Disabled : []openshiftv1.FeatureGateAttributes {{Name : apifeatures .FeatureGateMachineAPIOperatorDisableMachineHealthCheckController }},
581
585
},
582
586
},
@@ -595,9 +599,7 @@ func TestMAOConfigFromInfrastructure(t *testing.T) {
595
599
KubeRBACProxy : images .KubeRBACProxy ,
596
600
},
597
601
PlatformType : kubemarkPlatform ,
598
- Features : map [string ]bool {
599
- "MachineAPIMigration" : true ,
600
- },
602
+ Features : enabledFeatureMap ,
601
603
},
602
604
},
603
605
{
@@ -612,7 +614,7 @@ func TestMAOConfigFromInfrastructure(t *testing.T) {
612
614
FeatureGates : []openshiftv1.FeatureGateDetails {
613
615
{
614
616
Version : "" ,
615
- Enabled : []openshiftv1. FeatureGateAttributes {{ Name : apifeatures . FeatureGateMachineAPIMigration }} ,
617
+ Enabled : enabledFeatureGates ,
616
618
Disabled : []openshiftv1.FeatureGateAttributes {{Name : apifeatures .FeatureGateMachineAPIOperatorDisableMachineHealthCheckController }},
617
619
},
618
620
},
@@ -631,9 +633,7 @@ func TestMAOConfigFromInfrastructure(t *testing.T) {
631
633
KubeRBACProxy : images .KubeRBACProxy ,
632
634
},
633
635
PlatformType : openshiftv1 .VSpherePlatformType ,
634
- Features : map [string ]bool {
635
- "MachineAPIMigration" : true ,
636
- },
636
+ Features : enabledFeatureMap ,
637
637
},
638
638
},
639
639
{
@@ -648,7 +648,7 @@ func TestMAOConfigFromInfrastructure(t *testing.T) {
648
648
FeatureGates : []openshiftv1.FeatureGateDetails {
649
649
{
650
650
Version : "" ,
651
- Enabled : []openshiftv1. FeatureGateAttributes {{ Name : apifeatures . FeatureGateMachineAPIMigration }} ,
651
+ Enabled : enabledFeatureGates ,
652
652
Disabled : []openshiftv1.FeatureGateAttributes {{Name : apifeatures .FeatureGateMachineAPIOperatorDisableMachineHealthCheckController }},
653
653
},
654
654
},
@@ -667,9 +667,7 @@ func TestMAOConfigFromInfrastructure(t *testing.T) {
667
667
KubeRBACProxy : images .KubeRBACProxy ,
668
668
},
669
669
PlatformType : openshiftv1 .OvirtPlatformType ,
670
- Features : map [string ]bool {
671
- "MachineAPIMigration" : true ,
672
- },
670
+ Features : enabledFeatureMap ,
673
671
},
674
672
},
675
673
{
@@ -684,7 +682,7 @@ func TestMAOConfigFromInfrastructure(t *testing.T) {
684
682
FeatureGates : []openshiftv1.FeatureGateDetails {
685
683
{
686
684
Version : "" ,
687
- Enabled : []openshiftv1. FeatureGateAttributes {{ Name : apifeatures . FeatureGateMachineAPIMigration }} ,
685
+ Enabled : enabledFeatureGates ,
688
686
Disabled : []openshiftv1.FeatureGateAttributes {{Name : apifeatures .FeatureGateMachineAPIOperatorDisableMachineHealthCheckController }},
689
687
},
690
688
},
@@ -703,9 +701,7 @@ func TestMAOConfigFromInfrastructure(t *testing.T) {
703
701
KubeRBACProxy : images .KubeRBACProxy ,
704
702
},
705
703
PlatformType : openshiftv1 .NonePlatformType ,
706
- Features : map [string ]bool {
707
- "MachineAPIMigration" : true ,
708
- },
704
+ Features : enabledFeatureMap ,
709
705
},
710
706
},
711
707
{
@@ -722,7 +718,7 @@ func TestMAOConfigFromInfrastructure(t *testing.T) {
722
718
FeatureGates : []openshiftv1.FeatureGateDetails {
723
719
{
724
720
Version : "" ,
725
- Enabled : []openshiftv1. FeatureGateAttributes {{ Name : apifeatures . FeatureGateMachineAPIMigration }} ,
721
+ Enabled : enabledFeatureGates ,
726
722
Disabled : []openshiftv1.FeatureGateAttributes {{Name : apifeatures .FeatureGateMachineAPIOperatorDisableMachineHealthCheckController }},
727
723
},
728
724
},
@@ -741,9 +737,7 @@ func TestMAOConfigFromInfrastructure(t *testing.T) {
741
737
KubeRBACProxy : images .KubeRBACProxy ,
742
738
},
743
739
PlatformType : openshiftv1 .BareMetalPlatformType ,
744
- Features : map [string ]bool {
745
- "MachineAPIMigration" : true ,
746
- },
740
+ Features : enabledFeatureMap ,
747
741
},
748
742
},
749
743
{
@@ -758,7 +752,7 @@ func TestMAOConfigFromInfrastructure(t *testing.T) {
758
752
FeatureGates : []openshiftv1.FeatureGateDetails {
759
753
{
760
754
Version : "" ,
761
- Enabled : [] openshiftv1.FeatureGateAttributes {{ Name : apifeatures .FeatureGateMachineAPIOperatorDisableMachineHealthCheckController }, { Name : apifeatures . FeatureGateMachineAPIMigration }} ,
755
+ Enabled : append ( enabledFeatureGates , openshiftv1.FeatureGateAttributes {Name : apifeatures .FeatureGateMachineAPIOperatorDisableMachineHealthCheckController }) ,
762
756
Disabled : []openshiftv1.FeatureGateAttributes {},
763
757
},
764
758
},
@@ -777,9 +771,7 @@ func TestMAOConfigFromInfrastructure(t *testing.T) {
777
771
KubeRBACProxy : images .KubeRBACProxy ,
778
772
},
779
773
PlatformType : openshiftv1 .BareMetalPlatformType ,
780
- Features : map [string ]bool {
781
- "MachineAPIMigration" : true ,
782
- },
774
+ Features : enabledFeatureMap ,
783
775
},
784
776
},
785
777
{
@@ -794,7 +786,7 @@ func TestMAOConfigFromInfrastructure(t *testing.T) {
794
786
FeatureGates : []openshiftv1.FeatureGateDetails {
795
787
{
796
788
Version : "" ,
797
- Enabled : []openshiftv1. FeatureGateAttributes {{ Name : apifeatures . FeatureGateMachineAPIMigration }} ,
789
+ Enabled : enabledFeatureGates ,
798
790
Disabled : []openshiftv1.FeatureGateAttributes {{Name : apifeatures .FeatureGateMachineAPIOperatorDisableMachineHealthCheckController }},
799
791
},
800
792
},
@@ -813,9 +805,7 @@ func TestMAOConfigFromInfrastructure(t *testing.T) {
813
805
KubeRBACProxy : images .KubeRBACProxy ,
814
806
},
815
807
PlatformType : "bad-platform" ,
816
- Features : map [string ]bool {
817
- "MachineAPIMigration" : true ,
818
- },
808
+ Features : enabledFeatureMap ,
819
809
},
820
810
},
821
811
{
0 commit comments