@@ -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
717
eventuallyNonControlPlaneNodes (ctx , f .ClientSet ).Should (MatchLabels (expectedLabels , nodes , false ))
718
+ eventuallyNonControlPlaneNodes (ctx , f .ClientSet ).Should (MatchAnnotations (expectedAnnotations , nodes , false ))
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
- }
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
+
743
746
eventuallyNonControlPlaneNodes (ctx , f .ClientSet ).Should (MatchTaints (expectedTaints , nodes , false ))
744
- eventuallyNonControlPlaneNodes (ctx , f .ClientSet ).Should (MatchAnnotations (expectedAnnotations , nodes , true ))
747
+ eventuallyNonControlPlaneNodes (ctx , f .ClientSet ).Should (MatchAnnotations (expectedAnnotations , nodes , false ))
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 ())
@@ -761,15 +764,17 @@ core:
761
764
762
765
By ("Verifying updated node taints and annotation from NodeFeatureRules #3" )
763
766
eventuallyNonControlPlaneNodes (ctx , f .ClientSet ).Should (MatchTaints (expectedTaints , nodes , false ))
764
- eventuallyNonControlPlaneNodes (ctx , f .ClientSet ).Should (MatchAnnotations (expectedAnnotations , nodes , true ))
767
+ eventuallyNonControlPlaneNodes (ctx , f .ClientSet ).Should (MatchAnnotations (expectedAnnotations , nodes , false ))
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 {}
773
+ delete (expectedAnnotations ["*" ], "nfd.node.kubernetes.io/taints" )
770
774
eventuallyNonControlPlaneNodes (ctx , f .ClientSet ).Should (MatchTaints (expectedTaints , nodes , false ))
775
+ eventuallyNonControlPlaneNodes (ctx , f .ClientSet ).Should (MatchAnnotations (expectedAnnotations , nodes , false ))
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,7 +788,7 @@ 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 , false ))
787
792
788
793
By ("Verfiying node status capacity from NodeFeatureRules #4" )
789
794
eventuallyNonControlPlaneNodes (ctx , f .ClientSet ).Should (MatchCapacity (expectedCapacity , nodes , false ))
@@ -794,7 +799,9 @@ core:
794
799
795
800
By ("Verfiying node status capacity from NodeFeatureRules #4" )
796
801
expectedCapacity = map [string ]corev1.ResourceList {"*" : {}}
802
+ delete (expectedAnnotations ["*" ], "nfd.node.kubernetes.io/extended-resources" )
797
803
eventuallyNonControlPlaneNodes (ctx , f .ClientSet ).Should (MatchCapacity (expectedCapacity , nodes , false ))
804
+ eventuallyNonControlPlaneNodes (ctx , f .ClientSet ).Should (MatchAnnotations (expectedAnnotations , nodes , false ))
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 {})
0 commit comments