@@ -294,7 +294,7 @@ var _ = SIGDescribe("NFD master and worker", func() {
294
294
},
295
295
"*" : {},
296
296
}
297
- eventuallyNonControlPlaneNodes (ctx , f .ClientSet ).Should (MatchLabels (expectedLabels , nodes , false ))
297
+ eventuallyNonControlPlaneNodes (ctx , f .ClientSet ).Should (MatchLabels (expectedLabels , nodes ))
298
298
299
299
checkNodeFeatureObject (ctx , workerPod .Spec .NodeName )
300
300
@@ -478,7 +478,7 @@ var _ = SIGDescribe("NFD master and worker", func() {
478
478
},
479
479
"*" : {},
480
480
}
481
- eventuallyNonControlPlaneNodes (ctx , f .ClientSet ).Should (MatchLabels (expectedLabels , nodes , false ))
481
+ eventuallyNonControlPlaneNodes (ctx , f .ClientSet ).Should (MatchLabels (expectedLabels , nodes ))
482
482
483
483
By ("Deleting nfd-worker daemonset" )
484
484
err = f .ClientSet .AppsV1 ().DaemonSets (f .Namespace .Name ).Delete (ctx , workerDS .Name , metav1.DeleteOptions {})
@@ -523,14 +523,14 @@ var _ = SIGDescribe("NFD master and worker", func() {
523
523
},
524
524
"*" : {},
525
525
}
526
- eventuallyNonControlPlaneNodes (ctx , f .ClientSet ).Should (MatchLabels (expectedLabels , nodes , false ))
526
+ eventuallyNonControlPlaneNodes (ctx , f .ClientSet ).Should (MatchLabels (expectedLabels , nodes ))
527
527
By ("Deleting NodeFeature object" )
528
528
err = nfdClient .NfdV1alpha1 ().NodeFeatures (f .Namespace .Name ).Delete (ctx , nodeFeatures [0 ], metav1.DeleteOptions {})
529
529
Expect (err ).NotTo (HaveOccurred ())
530
530
531
531
By ("Verifying node labels from NodeFeature object were removed" )
532
532
expectedLabels [targetNodeName ] = k8sLabels {}
533
- eventuallyNonControlPlaneNodes (ctx , f .ClientSet ).Should (MatchLabels (expectedLabels , nodes , false ))
533
+ eventuallyNonControlPlaneNodes (ctx , f .ClientSet ).Should (MatchLabels (expectedLabels , nodes ))
534
534
535
535
By ("Creating nfd-worker daemonset" )
536
536
podSpecOpts := createPodSpecOpts (
@@ -552,7 +552,7 @@ var _ = SIGDescribe("NFD master and worker", func() {
552
552
nfdv1alpha1 .FeatureLabelNs + "/fake-fakefeature3" : "true" ,
553
553
},
554
554
}
555
- eventuallyNonControlPlaneNodes (ctx , f .ClientSet ).Should (MatchLabels (expectedLabels , nodes , false ))
555
+ eventuallyNonControlPlaneNodes (ctx , f .ClientSet ).Should (MatchLabels (expectedLabels , nodes ))
556
556
557
557
By ("Re-creating NodeFeature object" )
558
558
_ , err = testutils .CreateOrUpdateNodeFeaturesFromFile (ctx , nfdClient , "nodefeature-1.yaml" , f .Namespace .Name , targetNodeName )
@@ -566,7 +566,7 @@ var _ = SIGDescribe("NFD master and worker", func() {
566
566
nfdv1alpha1 .FeatureLabelNs + "/fake-fakefeature2" : "true" ,
567
567
nfdv1alpha1 .FeatureLabelNs + "/fake-fakefeature3" : "overridden" ,
568
568
}
569
- eventuallyNonControlPlaneNodes (ctx , f .ClientSet ).Should (MatchLabels (expectedLabels , nodes , false ))
569
+ eventuallyNonControlPlaneNodes (ctx , f .ClientSet ).Should (MatchLabels (expectedLabels , nodes ))
570
570
571
571
By ("Creating extra namespace" )
572
572
extraNs , err := f .CreateNamespace (ctx , "node-feature-discvery-extra-ns" , nil )
@@ -579,7 +579,7 @@ var _ = SIGDescribe("NFD master and worker", func() {
579
579
By ("Verifying node labels from NodeFeature object #2 are created" )
580
580
expectedLabels [targetNodeName ][nfdv1alpha1 .FeatureLabelNs + "/e2e-nodefeature-test-1" ] = "overridden-from-obj-2"
581
581
expectedLabels [targetNodeName ][nfdv1alpha1 .FeatureLabelNs + "/e2e-nodefeature-test-3" ] = "obj-2"
582
- eventuallyNonControlPlaneNodes (ctx , f .ClientSet ).Should (MatchLabels (expectedLabels , nodes , false ))
582
+ eventuallyNonControlPlaneNodes (ctx , f .ClientSet ).Should (MatchLabels (expectedLabels , nodes ))
583
583
584
584
By ("Deleting NodeFeature object from the extra namespace" )
585
585
err = nfdClient .NfdV1alpha1 ().NodeFeatures (extraNs .Name ).Delete (ctx , nodeFeatures [0 ], metav1.DeleteOptions {})
@@ -588,7 +588,7 @@ var _ = SIGDescribe("NFD master and worker", func() {
588
588
By ("Verifying node labels from NodeFeature object were removed" )
589
589
expectedLabels [targetNodeName ][nfdv1alpha1 .FeatureLabelNs + "/e2e-nodefeature-test-1" ] = "obj-1"
590
590
delete (expectedLabels [targetNodeName ], nfdv1alpha1 .FeatureLabelNs + "/e2e-nodefeature-test-3" )
591
- eventuallyNonControlPlaneNodes (ctx , f .ClientSet ).Should (MatchLabels (expectedLabels , nodes , false ))
591
+ eventuallyNonControlPlaneNodes (ctx , f .ClientSet ).Should (MatchLabels (expectedLabels , nodes ))
592
592
})
593
593
594
594
It ("denied labels should not be created by the NodeFeature object" , func (ctx context.Context ) {
@@ -615,14 +615,14 @@ var _ = SIGDescribe("NFD master and worker", func() {
615
615
"custom.vendor.io/e2e-nodefeature-test-3" : "vendor-ns" ,
616
616
},
617
617
}
618
- eventuallyNonControlPlaneNodes (ctx , f .ClientSet ).Should (MatchLabels (expectedLabels , nodes , false ))
618
+ eventuallyNonControlPlaneNodes (ctx , f .ClientSet ).Should (MatchLabels (expectedLabels , nodes ))
619
619
620
620
By ("Deleting NodeFeature object" )
621
621
err = nfdClient .NfdV1alpha1 ().NodeFeatures (f .Namespace .Name ).Delete (ctx , nodeFeatures [0 ], metav1.DeleteOptions {})
622
622
Expect (err ).NotTo (HaveOccurred ())
623
623
624
624
expectedLabels [targetNodeName ] = k8sLabels {}
625
- eventuallyNonControlPlaneNodes (ctx , f .ClientSet ).Should (MatchLabels (expectedLabels , nodes , false ))
625
+ eventuallyNonControlPlaneNodes (ctx , f .ClientSet ).Should (MatchLabels (expectedLabels , nodes ))
626
626
})
627
627
})
628
628
@@ -698,7 +698,7 @@ core:
698
698
Expect (testutils .CreateNodeFeatureRulesFromFile (ctx , nfdClient , "nodefeaturerule-1.yaml" )).NotTo (HaveOccurred ())
699
699
700
700
By ("Verifying node labels from NodeFeatureRules #1" )
701
- eventuallyNonControlPlaneNodes (ctx , f .ClientSet ).Should (MatchLabels (expectedLabels , nodes , false ))
701
+ eventuallyNonControlPlaneNodes (ctx , f .ClientSet ).Should (MatchLabels (expectedLabels , nodes ))
702
702
703
703
By ("Creating NodeFeatureRules #2" )
704
704
Expect (testutils .CreateNodeFeatureRulesFromFile (ctx , nfdClient , "nodefeaturerule-2.yaml" )).NotTo (HaveOccurred ())
@@ -708,9 +708,14 @@ core:
708
708
expectedLabels ["*" ][nfdv1alpha1 .FeatureLabelNs + "/e2e-template-test-1-instance_1" ] = "found"
709
709
expectedLabels ["*" ][nfdv1alpha1 .FeatureLabelNs + "/e2e-template-test-1-instance_2" ] = "found"
710
710
expectedLabels ["*" ][nfdv1alpha1 .FeatureLabelNs + "/dynamic-label" ] = "true"
711
+ expectedAnnotations := map [string ]k8sAnnotations {
712
+ "*" : {
713
+ "nfd.node.kubernetes.io/feature-labels" : "dynamic-label,e2e-attribute-test-1,e2e-flag-test-1,e2e-instance-test-1,e2e-matchany-test-1,e2e-template-test-1-instance_1,e2e-template-test-1-instance_2" },
714
+ }
711
715
712
716
By ("Verifying node labels from NodeFeatureRules #1 and #2" )
713
- eventuallyNonControlPlaneNodes (ctx , f .ClientSet ).Should (MatchLabels (expectedLabels , nodes , false ))
717
+ eventuallyNonControlPlaneNodes (ctx , f .ClientSet ).Should (MatchLabels (expectedLabels , nodes ))
718
+ eventuallyNonControlPlaneNodes (ctx , f .ClientSet ).Should (MatchAnnotations (expectedAnnotations , nodes ))
714
719
715
720
// Add features from NodeFeatureRule #3
716
721
By ("Creating NodeFeatureRules #3" )
@@ -736,12 +741,10 @@ core:
736
741
},
737
742
},
738
743
}
739
- expectedAnnotations := map [string ]k8sAnnotations {
740
- "*" : {
741
- "nfd.node.kubernetes.io/taints" : "feature.node.kubernetes.io/fake-special-node=exists:PreferNoSchedule,feature.node.kubernetes.io/fake-dedicated-node=true:NoExecute,feature.node.kubernetes.io/performance-optimized-node=true:NoExecute" },
742
- }
743
- eventuallyNonControlPlaneNodes (ctx , f .ClientSet ).Should (MatchTaints (expectedTaints , nodes , false ))
744
- eventuallyNonControlPlaneNodes (ctx , f .ClientSet ).Should (MatchAnnotations (expectedAnnotations , nodes , true ))
744
+ expectedAnnotations ["*" ]["nfd.node.kubernetes.io/taints" ] = "feature.node.kubernetes.io/fake-special-node=exists:PreferNoSchedule,feature.node.kubernetes.io/fake-dedicated-node=true:NoExecute,feature.node.kubernetes.io/performance-optimized-node=true:NoExecute"
745
+
746
+ eventuallyNonControlPlaneNodes (ctx , f .ClientSet ).Should (MatchTaints (expectedTaints , nodes ))
747
+ eventuallyNonControlPlaneNodes (ctx , f .ClientSet ).Should (MatchAnnotations (expectedAnnotations , nodes ))
745
748
746
749
By ("Re-applying NodeFeatureRules #3 with updated taints" )
747
750
Expect (testutils .UpdateNodeFeatureRulesFromFile (ctx , nfdClient , "nodefeaturerule-3-updated.yaml" )).NotTo (HaveOccurred ())
@@ -760,16 +763,18 @@ core:
760
763
expectedAnnotations ["*" ]["nfd.node.kubernetes.io/taints" ] = "feature.node.kubernetes.io/fake-special-node=exists:PreferNoSchedule,feature.node.kubernetes.io/foo=true:NoExecute"
761
764
762
765
By ("Verifying updated node taints and annotation from NodeFeatureRules #3" )
763
- eventuallyNonControlPlaneNodes (ctx , f .ClientSet ).Should (MatchTaints (expectedTaints , nodes , false ))
764
- eventuallyNonControlPlaneNodes (ctx , f .ClientSet ).Should (MatchAnnotations (expectedAnnotations , nodes , true ))
766
+ eventuallyNonControlPlaneNodes (ctx , f .ClientSet ).Should (MatchTaints (expectedTaints , nodes ))
767
+ eventuallyNonControlPlaneNodes (ctx , f .ClientSet ).Should (MatchAnnotations (expectedAnnotations , nodes ))
765
768
766
769
By ("Deleting NodeFeatureRule object" )
767
770
err = nfdClient .NfdV1alpha1 ().NodeFeatureRules ().Delete (ctx , "e2e-test-3" , metav1.DeleteOptions {})
768
771
Expect (err ).NotTo (HaveOccurred ())
769
772
expectedTaints ["*" ] = []corev1.Taint {}
770
- eventuallyNonControlPlaneNodes (ctx , f .ClientSet ).Should (MatchTaints (expectedTaints , nodes , false ))
773
+ delete (expectedAnnotations ["*" ], "nfd.node.kubernetes.io/taints" )
774
+ eventuallyNonControlPlaneNodes (ctx , f .ClientSet ).Should (MatchTaints (expectedTaints , nodes ))
775
+ eventuallyNonControlPlaneNodes (ctx , f .ClientSet ).Should (MatchAnnotations (expectedAnnotations , nodes ))
771
776
772
- expectedAnnotations ["*" ] = k8sAnnotations { "nfd.node.kubernetes.io/extended-resources" : "nons,vendor.feature.node.kubernetes.io/static,vendor.io/dynamic" }
777
+ expectedAnnotations ["*" ][ "nfd.node.kubernetes.io/extended-resources" ] = "nons,vendor.feature.node.kubernetes.io/static,vendor.io/dynamic"
773
778
774
779
expectedCapacity := map [string ]corev1.ResourceList {
775
780
"*" : {
@@ -783,18 +788,20 @@ core:
783
788
Expect (testutils .CreateNodeFeatureRulesFromFile (ctx , nfdClient , "nodefeaturerule-4.yaml" )).NotTo (HaveOccurred ())
784
789
785
790
By ("Verifying node annotations from NodeFeatureRules #4" )
786
- eventuallyNonControlPlaneNodes (ctx , f .ClientSet ).Should (MatchAnnotations (expectedAnnotations , nodes , true ))
791
+ eventuallyNonControlPlaneNodes (ctx , f .ClientSet ).Should (MatchAnnotations (expectedAnnotations , nodes ))
787
792
788
793
By ("Verfiying node status capacity from NodeFeatureRules #4" )
789
- eventuallyNonControlPlaneNodes (ctx , f .ClientSet ).Should (MatchCapacity (expectedCapacity , nodes , false ))
794
+ eventuallyNonControlPlaneNodes (ctx , f .ClientSet ).Should (MatchCapacity (expectedCapacity , nodes ))
790
795
791
796
By ("Deleting NodeFeatureRule object" )
792
797
err = nfdClient .NfdV1alpha1 ().NodeFeatureRules ().Delete (ctx , "e2e-extened-resource-test" , metav1.DeleteOptions {})
793
798
Expect (err ).NotTo (HaveOccurred ())
794
799
795
800
By ("Verfiying node status capacity from NodeFeatureRules #4" )
796
801
expectedCapacity = map [string ]corev1.ResourceList {"*" : {}}
797
- eventuallyNonControlPlaneNodes (ctx , f .ClientSet ).Should (MatchCapacity (expectedCapacity , nodes , false ))
802
+ delete (expectedAnnotations ["*" ], "nfd.node.kubernetes.io/extended-resources" )
803
+ eventuallyNonControlPlaneNodes (ctx , f .ClientSet ).Should (MatchCapacity (expectedCapacity , nodes ))
804
+ eventuallyNonControlPlaneNodes (ctx , f .ClientSet ).Should (MatchAnnotations (expectedAnnotations , nodes ))
798
805
799
806
By ("Deleting nfd-worker daemonset" )
800
807
err = f .ClientSet .AppsV1 ().DaemonSets (f .Namespace .Name ).Delete (ctx , workerDS .Name , metav1.DeleteOptions {})
@@ -838,7 +845,7 @@ denyLabelNs: ["*.denied.ns","random.unwanted.ns"]
838
845
"custom.vendor.io/e2e-nodefeature-test-3" : "vendor-ns" ,
839
846
},
840
847
}
841
- eventuallyNonControlPlaneNodes (ctx , f .ClientSet ).Should (MatchLabels (expectedLabels , nodes , false ))
848
+ eventuallyNonControlPlaneNodes (ctx , f .ClientSet ).Should (MatchLabels (expectedLabels , nodes ))
842
849
By ("Deleting NodeFeature object" )
843
850
err = nfdClient .NfdV1alpha1 ().NodeFeatures (f .Namespace .Name ).Delete (ctx , nodeFeatures [0 ], metav1.DeleteOptions {})
844
851
Expect (err ).NotTo (HaveOccurred ())
@@ -859,7 +866,7 @@ denyLabelNs: []
859
866
"random.unwanted.ns/e2e-nodefeature-test-2" : "unwanted-ns" ,
860
867
},
861
868
}
862
- eventuallyNonControlPlaneNodes (ctx , f .ClientSet ).Should (MatchLabels (expectedLabels , nodes , false ))
869
+ eventuallyNonControlPlaneNodes (ctx , f .ClientSet ).Should (MatchLabels (expectedLabels , nodes ))
863
870
})
864
871
})
865
872
@@ -900,7 +907,7 @@ resyncPeriod: "1s"
900
907
},
901
908
"*" : {},
902
909
}
903
- eventuallyNonControlPlaneNodes (ctx , f .ClientSet ).Should (MatchLabels (expectedLabels , nodes , false ))
910
+ eventuallyNonControlPlaneNodes (ctx , f .ClientSet ).Should (MatchLabels (expectedLabels , nodes ))
904
911
905
912
patches , err := json .Marshal (
906
913
[]apihelper.JsonPatch {
@@ -917,7 +924,7 @@ resyncPeriod: "1s"
917
924
_ , err = f .ClientSet .CoreV1 ().Nodes ().Patch (ctx , targetNodeName , types .JSONPatchType , patches , metav1.PatchOptions {})
918
925
Expect (err ).NotTo (HaveOccurred ())
919
926
920
- eventuallyNonControlPlaneNodes (ctx , f .ClientSet ).Should (MatchLabels (expectedLabels , nodes , false ))
927
+ eventuallyNonControlPlaneNodes (ctx , f .ClientSet ).Should (MatchLabels (expectedLabels , nodes ))
921
928
922
929
By ("Deleting NodeFeature object" )
923
930
err = nfdClient .NfdV1alpha1 ().NodeFeatures (f .Namespace .Name ).Delete (ctx , nodeFeatures [0 ], metav1.DeleteOptions {})
0 commit comments