From 0d766a0fdeba10570df5f4cbe6307067baa54356 Mon Sep 17 00:00:00 2001 From: Markus Lehtonen Date: Thu, 26 Oct 2023 22:30:43 +0300 Subject: [PATCH] test/e2e: fix broken feature-annotations test --- test/e2e/node_feature_discovery_test.go | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/test/e2e/node_feature_discovery_test.go b/test/e2e/node_feature_discovery_test.go index b7bef9938..b8038d8d0 100644 --- a/test/e2e/node_feature_discovery_test.go +++ b/test/e2e/node_feature_discovery_test.go @@ -807,19 +807,22 @@ core: Expect(testutils.CreateNodeFeatureRulesFromFile(ctx, nfdClient, "nodefeaturerule-5.yaml")).NotTo(HaveOccurred()) By("Verifying node annotations from NodeFeatureRules #5") - expectedAnnotations["*"] = k8sAnnotations{ - nfdv1alpha1.FeatureLabelNs + "/defaul-ns-annotation": "foo", - nfdv1alpha1.FeatureLabelNs + "/defaul-ns-annotation-2": "bar", - "custom.vendor.example/feature": "baz", - } + expectedAnnotations["*"][nfdv1alpha1.FeatureAnnotationNs+"/defaul-ns-annotation"] = "foo" + expectedAnnotations["*"][nfdv1alpha1.FeatureAnnotationNs+"/defaul-ns-annotation-2"] = "bar" + expectedAnnotations["*"]["custom.vendor.io/feature"] = "baz" + expectedAnnotations["*"][nfdv1alpha1.FeatureAnnotationsTrackingAnnotation] = "custom.vendor.io/feature,defaul-ns-annotation,defaul-ns-annotation-2" + eventuallyNonControlPlaneNodes(ctx, f.ClientSet).Should(MatchAnnotations(expectedAnnotations, nodes)) By("Deleting NodeFeatureRule object") - err = nfdClient.NfdV1alpha1().NodeFeatureRules().Delete(ctx, " e2e-feature-annotations-test", metav1.DeleteOptions{}) + err = nfdClient.NfdV1alpha1().NodeFeatureRules().Delete(ctx, "e2e-feature-annotations-test", metav1.DeleteOptions{}) Expect(err).NotTo(HaveOccurred()) By("Verifying node annotations from NodeFeatureRules #5 are deleted") - expectedAnnotations["*"] = k8sAnnotations{} + delete(expectedAnnotations["*"], nfdv1alpha1.FeatureAnnotationNs+"/defaul-ns-annotation") + delete(expectedAnnotations["*"], nfdv1alpha1.FeatureAnnotationNs+"/defaul-ns-annotation-2") + delete(expectedAnnotations["*"], "custom.vendor.io/feature") + delete(expectedAnnotations["*"], nfdv1alpha1.FeatureAnnotationsTrackingAnnotation) eventuallyNonControlPlaneNodes(ctx, f.ClientSet).Should(MatchAnnotations(expectedAnnotations, nodes)) By("Deleting nfd-worker daemonset")