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

Fixes #33948

Co-authored-by: Anatoly Fayngelerin <afayngelerin@dropbox.com>
This commit is contained in:
afayngelerindbx 2021-05-12 04:44:00 -04:00 committed by GitHub
parent c6dd19f163
commit b0094b325e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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
}