Skip to content

Commit

Permalink
Fix error message for images not found
Browse files Browse the repository at this point in the history
  • Loading branch information
motoki317 committed Apr 18, 2024
1 parent b5c6878 commit 0c9afc8
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions pkg/usecase/cleaner/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package cleaner
import (
"context"
"fmt"
"github.com/regclient/regclient/types/errs"
"sync"
"time"

Expand Down Expand Up @@ -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")
}
Expand Down

0 comments on commit 0c9afc8

Please sign in to comment.