Skip to content

Commit 0d766a0

Browse files
committed
test/e2e: fix broken feature-annotations test
1 parent dabd766 commit 0d766a0

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

test/e2e/node_feature_discovery_test.go

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -807,19 +807,22 @@ core:
807807
Expect(testutils.CreateNodeFeatureRulesFromFile(ctx, nfdClient, "nodefeaturerule-5.yaml")).NotTo(HaveOccurred())
808808

809809
By("Verifying node annotations from NodeFeatureRules #5")
810-
expectedAnnotations["*"] = k8sAnnotations{
811-
nfdv1alpha1.FeatureLabelNs + "/defaul-ns-annotation": "foo",
812-
nfdv1alpha1.FeatureLabelNs + "/defaul-ns-annotation-2": "bar",
813-
"custom.vendor.example/feature": "baz",
814-
}
810+
expectedAnnotations["*"][nfdv1alpha1.FeatureAnnotationNs+"/defaul-ns-annotation"] = "foo"
811+
expectedAnnotations["*"][nfdv1alpha1.FeatureAnnotationNs+"/defaul-ns-annotation-2"] = "bar"
812+
expectedAnnotations["*"]["custom.vendor.io/feature"] = "baz"
813+
expectedAnnotations["*"][nfdv1alpha1.FeatureAnnotationsTrackingAnnotation] = "custom.vendor.io/feature,defaul-ns-annotation,defaul-ns-annotation-2"
814+
815815
eventuallyNonControlPlaneNodes(ctx, f.ClientSet).Should(MatchAnnotations(expectedAnnotations, nodes))
816816

817817
By("Deleting NodeFeatureRule object")
818-
err = nfdClient.NfdV1alpha1().NodeFeatureRules().Delete(ctx, " e2e-feature-annotations-test", metav1.DeleteOptions{})
818+
err = nfdClient.NfdV1alpha1().NodeFeatureRules().Delete(ctx, "e2e-feature-annotations-test", metav1.DeleteOptions{})
819819
Expect(err).NotTo(HaveOccurred())
820820

821821
By("Verifying node annotations from NodeFeatureRules #5 are deleted")
822-
expectedAnnotations["*"] = k8sAnnotations{}
822+
delete(expectedAnnotations["*"], nfdv1alpha1.FeatureAnnotationNs+"/defaul-ns-annotation")
823+
delete(expectedAnnotations["*"], nfdv1alpha1.FeatureAnnotationNs+"/defaul-ns-annotation-2")
824+
delete(expectedAnnotations["*"], "custom.vendor.io/feature")
825+
delete(expectedAnnotations["*"], nfdv1alpha1.FeatureAnnotationsTrackingAnnotation)
823826
eventuallyNonControlPlaneNodes(ctx, f.ClientSet).Should(MatchAnnotations(expectedAnnotations, nodes))
824827

825828
By("Deleting nfd-worker daemonset")

0 commit comments

Comments
 (0)