From d19f33b52f09b5f1eb0e9d490f6586efd680d0f9 Mon Sep 17 00:00:00 2001 From: Carl Bergquist Date: Thu, 9 Sep 2021 18:13:14 +0200 Subject: [PATCH] Annotations: don't log context.Cancelled as an error when cleaning up (#39024) Signed-off-by: bergquist --- pkg/services/cleanup/cleanup.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkg/services/cleanup/cleanup.go b/pkg/services/cleanup/cleanup.go index efc4957377f..ade5c888590 100644 --- a/pkg/services/cleanup/cleanup.go +++ b/pkg/services/cleanup/cleanup.go @@ -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)