Skip to content

Commit 7015dae

Browse files
committed
test/e2e: cleanup feature annotations
Delete NFD-managed feature annotations at test setup and teardown
1 parent 6b90401 commit 7015dae

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

test/e2e/node_feature_discovery_test.go

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,12 @@ func cleanupNode(ctx context.Context, cs clientset.Interface) {
6666
nfdLabels[name] = struct{}{}
6767
}
6868
}
69+
nfdAnnotations := map[string]struct{}{}
70+
for _, name := range strings.Split(node.Annotations[nfdv1alpha1.FeatureAnnotationsTrackingAnnotation], ",") {
71+
if strings.Contains(name, "/") {
72+
nfdAnnotations[name] = struct{}{}
73+
}
74+
}
6975
nfdERs := map[string]struct{}{}
7076
for _, name := range strings.Split(node.Annotations[nfdv1alpha1.ExtendedResourceAnnotation], ",") {
7177
if strings.Contains(name, "/") {
@@ -84,7 +90,8 @@ func cleanupNode(ctx context.Context, cs clientset.Interface) {
8490

8591
// Remove annotations
8692
for key := range node.Annotations {
87-
if strings.HasPrefix(key, nfdv1alpha1.AnnotationNs) {
93+
_, ok := nfdAnnotations[key]
94+
if ok || strings.HasPrefix(key, nfdv1alpha1.AnnotationNs) || strings.HasPrefix(key, nfdv1alpha1.FeatureAnnotationNs) {
8895
delete(node.Annotations, key)
8996
update = true
9097
}

0 commit comments

Comments
 (0)