Skip to content

Commit

Permalink
Return error if no bundles exist in registry
Browse files Browse the repository at this point in the history
Signed-off-by: Cody Soyland <codysoyland@github.com>
  • Loading branch information
codysoyland committed Feb 25, 2025
1 parent a4d736d commit adfe2e3
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions pkg/cosign/verify.go
Original file line number Diff line number Diff line change
Expand Up @@ -1551,6 +1551,12 @@ func getBundles(_ context.Context, signedImgRef name.Reference, co *CheckOpts) (
bundles = append(bundles, bundle)
}

if len(bundles) == 0 {
return nil, nil, &ErrNoMatchingAttestations{
fmt.Errorf("no valid bundles exist in registry"),
}
}

return bundles, &h, nil
}

Expand Down

0 comments on commit adfe2e3

Please sign in to comment.