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