Annotations: don't log context.Cancelled as an error when cleaning up (#39024)

Signed-off-by: bergquist <carl.bergquist@gmail.com>
This commit is contained in:
Carl Bergquist 2021-09-09 18:13:14 +02:00 committed by GitHub
parent b56bf83c19
commit d19f33b52f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2,6 +2,7 @@ package cleanup
import (
"context"
"errors"
"io/ioutil"
"os"
"path"
@ -67,7 +68,7 @@ func (srv *CleanUpService) Run(ctx context.Context) error {
func (srv *CleanUpService) cleanUpOldAnnotations(ctx context.Context) {
cleaner := annotations.GetAnnotationCleaner()
affected, affectedTags, err := cleaner.CleanAnnotations(ctx, srv.Cfg)
if err != nil {
if err != nil && !errors.Is(err, context.DeadlineExceeded) {
srv.log.Error("failed to clean up old annotations", "error", err)
} else {
srv.log.Debug("Deleted excess annotations", "annotations affected", affected, "annotation tags affected", affectedTags)