diff --git a/cmd/hauler/cli/store/add.go b/cmd/hauler/cli/store/add.go index 8209ce4..dab32b8 100644 --- a/cmd/hauler/cli/store/add.go +++ b/cmd/hauler/cli/store/add.go @@ -76,12 +76,14 @@ func storeImage(ctx context.Context, s *store.Layout, i v1alpha1.Image, platform r, err := name.ParseReference(i.Name) if err != nil { - return err + l.Warnf("unable to parse 'image' [%s], skipping...", r.Name()) + return nil } err = cosign.SaveImage(ctx, s, r.Name(), platform) if err != nil { - return err + l.Warnf("unable to add 'image' [%s] to store. skipping...", r.Name()) + return nil } l.Infof("successfully added 'image' [%s]", r.Name()) diff --git a/pkg/cosign/cosign.go b/pkg/cosign/cosign.go index 10a2050..71fed74 100644 --- a/pkg/cosign/cosign.go +++ b/pkg/cosign/cosign.go @@ -92,7 +92,7 @@ func SaveImage(ctx context.Context, s *store.Layout, ref string, platform string // read command's stderr line by line errors := bufio.NewScanner(stderr) for errors.Scan() { - l.Errorf(errors.Text()) // write each line to your log, or anything you need + l.Warnf(errors.Text()) // write each line to your log, or anything you need } if err := errors.Err(); err != nil { cmd.Wait() @@ -200,7 +200,7 @@ func RetryOperation(ctx context.Context, operation func() error) error { } // Log the error for the current attempt. - l.Errorf("error (attempt %d/%d): %v", attempt, maxRetries, err) + l.Warnf("error (attempt %d/%d): %v", attempt, maxRetries, err) // If this is not the last attempt, wait before retrying. if attempt < maxRetries {