Skip to content

Commit

Permalink
Merge pull request #1440 from marquiz/devel/e2e-fix
Browse files Browse the repository at this point in the history
test/e2e: fix broken feature-annotations test
  • Loading branch information
k8s-ci-robot authored Oct 27, 2023
2 parents 362691a + 0d766a0 commit 6b90401
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions test/e2e/node_feature_discovery_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -808,19 +808,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")
Expand Down

0 comments on commit 6b90401

Please sign in to comment.