1
0
Fork 0
mirror of https://github.com/kubernetes-sigs/node-feature-discovery.git synced 2025-03-17 05:48:21 +00:00

Merge pull request #1440 from marquiz/devel/e2e-fix

test/e2e: fix broken feature-annotations test
This commit is contained in:
Kubernetes Prow Robot 2023-10-27 11:16:02 +02:00 committed by GitHub
commit 6b90401950
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -808,19 +808,22 @@ core:
Expect(testutils.CreateNodeFeatureRulesFromFile(ctx, nfdClient, "nodefeaturerule-5.yaml")).NotTo(HaveOccurred()) Expect(testutils.CreateNodeFeatureRulesFromFile(ctx, nfdClient, "nodefeaturerule-5.yaml")).NotTo(HaveOccurred())
By("Verifying node annotations from NodeFeatureRules #5") By("Verifying node annotations from NodeFeatureRules #5")
expectedAnnotations["*"] = k8sAnnotations{ expectedAnnotations["*"][nfdv1alpha1.FeatureAnnotationNs+"/defaul-ns-annotation"] = "foo"
nfdv1alpha1.FeatureLabelNs + "/defaul-ns-annotation": "foo", expectedAnnotations["*"][nfdv1alpha1.FeatureAnnotationNs+"/defaul-ns-annotation-2"] = "bar"
nfdv1alpha1.FeatureLabelNs + "/defaul-ns-annotation-2": "bar", expectedAnnotations["*"]["custom.vendor.io/feature"] = "baz"
"custom.vendor.example/feature": "baz", expectedAnnotations["*"][nfdv1alpha1.FeatureAnnotationsTrackingAnnotation] = "custom.vendor.io/feature,defaul-ns-annotation,defaul-ns-annotation-2"
}
eventuallyNonControlPlaneNodes(ctx, f.ClientSet).Should(MatchAnnotations(expectedAnnotations, nodes)) eventuallyNonControlPlaneNodes(ctx, f.ClientSet).Should(MatchAnnotations(expectedAnnotations, nodes))
By("Deleting NodeFeatureRule object") 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()) Expect(err).NotTo(HaveOccurred())
By("Verifying node annotations from NodeFeatureRules #5 are deleted") 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)) eventuallyNonControlPlaneNodes(ctx, f.ClientSet).Should(MatchAnnotations(expectedAnnotations, nodes))
By("Deleting nfd-worker daemonset") By("Deleting nfd-worker daemonset")