From 0c9afc8f999ea41c3cb66f1e2e68f6ccab660318 Mon Sep 17 00:00:00 2001 From: motoki317 Date: Thu, 18 Apr 2024 23:28:24 +0900 Subject: [PATCH] Fix error message for images not found --- pkg/usecase/cleaner/service.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pkg/usecase/cleaner/service.go b/pkg/usecase/cleaner/service.go index 535afc3f2..10310ad21 100644 --- a/pkg/usecase/cleaner/service.go +++ b/pkg/usecase/cleaner/service.go @@ -3,6 +3,7 @@ package cleaner import ( "context" "fmt" + "github.com/regclient/regclient/types/errs" "sync" "time" @@ -111,6 +112,10 @@ func (c *cleanerService) pruneImages(ctx context.Context, r *regclient.RegClient func (c *cleanerService) pruneImage(ctx context.Context, r *regclient.RegClient, app *domain.Application) error { imageName := c.image.ImageName(app.ID) tags, err := regutil.TagList(ctx, r, imageName) + if errors.Is(err, errs.ErrNotFound) { + // Skip not found error - this is expected (example: before first image upload) + return nil + } if err != nil { return errors.Wrap(err, "getting tags") }