Annotations: Prevent orphaned annotation tags cleanup when no annotations were cleaned (#33957) (#33975)

Fixes #33948

Co-authored-by: Anatoly Fayngelerin <afayngelerin@dropbox.com>
(cherry picked from commit b0094b325e)

Co-authored-by: afayngelerindbx <38990103+afayngelerindbx@users.noreply.github.com>
This commit is contained in:
Grot (@grafanabot)
2021-05-12 11:52:30 +02:00
committed by GitHub
co-authored by afayngelerindbx
parent a574f97b79
commit 774ffd939c
+3 -2
View File
@@ -47,8 +47,9 @@ func (acs *AnnotationCleanupService) CleanAnnotations(ctx context.Context, cfg *
if err != nil {
return totalCleanedAnnotations, 0, err
}
affected, err = acs.cleanOrphanedAnnotationTags(ctx)
if totalCleanedAnnotations > 0 {
affected, err = acs.cleanOrphanedAnnotationTags(ctx)
}
return totalCleanedAnnotations, affected, err
}