Skip to content

Commit 72fc478

Browse files
authored
Merge pull request #1443 from marquiz/devel/e2e-annotations-cleanup
test/e2e: cleanup feature annotations
2 parents 6b90401 + 7015dae commit 72fc478

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)