Skip to content

Commit

Permalink
Improve error message when no sigs/atts are found for an image (#2101)
Browse files Browse the repository at this point in the history
Signed-off-by: Jason Hall <jason@chainguard.dev>
  • Loading branch information
imjasonh authored Jul 26, 2022
1 parent 84087b2 commit 8066a9e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/cosign/fetch.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ func FetchSignaturesForReference(ctx context.Context, ref name.Reference, opts .
return nil, fmt.Errorf("fetching signatures: %w", err)
}
if len(l) == 0 {
return nil, fmt.Errorf("no signatures associated with %v: %w", ref, err)
return nil, fmt.Errorf("no signatures associated with %s", ref)
}

signatures := make([]SignedPayload, len(l))
Expand Down Expand Up @@ -126,7 +126,7 @@ func FetchAttestationsForReference(ctx context.Context, ref name.Reference, opts
return nil, fmt.Errorf("fetching attestations: %w", err)
}
if len(l) == 0 {
return nil, fmt.Errorf("no attestations associated with %v: %w", ref, err)
return nil, fmt.Errorf("no attestations associated with %s", ref)
}

attestations := make([]AttestationPayload, len(l))
Expand Down

0 comments on commit 8066a9e

Please sign in to comment.