Skip to content

Commit

Permalink
Differentiate error messages
Browse files Browse the repository at this point in the history
  • Loading branch information
sethvargo committed Oct 28, 2022
1 parent dd061fa commit 11c5615
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pkg/gcrcleaner/cleaner.go
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ func (c *Cleaner) Clean(ctx context.Context, repo string, since time.Time, keep
tagged := gcrrepo.Tag(tag)
if !dryRun {
if err := c.deleteOne(ctx, tagged); err != nil {
return nil, fmt.Errorf("failed to delete %s: %w", tagged, err)
return nil, fmt.Errorf("failed to delete tag %s: %w", tagged, err)
}
}

Expand All @@ -191,7 +191,7 @@ func (c *Cleaner) Clean(ctx context.Context, repo string, since time.Time, keep
if !dryRun {
if err := c.deleteOne(ctx, ref); err != nil {
errsLock.Lock()
errs = append(errs, err)
errs = append(errs, fmt.Errorf("failed to delete digest %s: %w", ref, err))
errsLock.Unlock()
}
}
Expand Down Expand Up @@ -230,7 +230,7 @@ func (c *Cleaner) deleteOne(ctx context.Context, ref gcrname.Reference) error {
gcrremote.WithUserAgent(userAgent),
gcrremote.WithAuthFromKeychain(c.keychain),
gcrremote.WithContext(ctx)); err != nil {
return fmt.Errorf("failed to delete %s: %w", ref, err)
return err
}

return nil
Expand Down

0 comments on commit 11c5615

Please sign in to comment.