Skip to content

Commit 6b90401

Browse files
authored
Merge pull request #1440 from marquiz/devel/e2e-fix
test/e2e: fix broken feature-annotations test
2 parents 362691a + 0d766a0 commit 6b90401

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
@@ -808,19 +808,22 @@ core:
808808
Expect(testutils.CreateNodeFeatureRulesFromFile(ctx, nfdClient, "nodefeaturerule-5.yaml")).NotTo(HaveOccurred())
809809

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

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

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

826829
By("Deleting nfd-worker daemonset")

0 commit comments

Comments
 (0)