mirror of
https://github.com/kubernetes-sigs/node-feature-discovery.git
synced 2025-03-15 21:08:23 +00:00
test/e2e: cleanup feature annotations
Delete NFD-managed feature annotations at test setup and teardown
This commit is contained in:
parent
6b90401950
commit
7015dae352
1 changed files with 8 additions and 1 deletions
|
@ -66,6 +66,12 @@ func cleanupNode(ctx context.Context, cs clientset.Interface) {
|
||||||
nfdLabels[name] = struct{}{}
|
nfdLabels[name] = struct{}{}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
nfdAnnotations := map[string]struct{}{}
|
||||||
|
for _, name := range strings.Split(node.Annotations[nfdv1alpha1.FeatureAnnotationsTrackingAnnotation], ",") {
|
||||||
|
if strings.Contains(name, "/") {
|
||||||
|
nfdAnnotations[name] = struct{}{}
|
||||||
|
}
|
||||||
|
}
|
||||||
nfdERs := map[string]struct{}{}
|
nfdERs := map[string]struct{}{}
|
||||||
for _, name := range strings.Split(node.Annotations[nfdv1alpha1.ExtendedResourceAnnotation], ",") {
|
for _, name := range strings.Split(node.Annotations[nfdv1alpha1.ExtendedResourceAnnotation], ",") {
|
||||||
if strings.Contains(name, "/") {
|
if strings.Contains(name, "/") {
|
||||||
|
@ -84,7 +90,8 @@ func cleanupNode(ctx context.Context, cs clientset.Interface) {
|
||||||
|
|
||||||
// Remove annotations
|
// Remove annotations
|
||||||
for key := range node.Annotations {
|
for key := range node.Annotations {
|
||||||
if strings.HasPrefix(key, nfdv1alpha1.AnnotationNs) {
|
_, ok := nfdAnnotations[key]
|
||||||
|
if ok || strings.HasPrefix(key, nfdv1alpha1.AnnotationNs) || strings.HasPrefix(key, nfdv1alpha1.FeatureAnnotationNs) {
|
||||||
delete(node.Annotations, key)
|
delete(node.Annotations, key)
|
||||||
update = true
|
update = true
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue