Skip to content

Commit

Permalink
Filter by bundle artifact type
Browse files Browse the repository at this point in the history
Signed-off-by: Cody Soyland <[email protected]>
  • Loading branch information
codysoyland committed Nov 6, 2024
1 parent ba5c7cb commit 7a4c4df
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) (
}
var bundles = make([]*sgbundle.Bundle, 0, len(index.Manifests))
for _, result := range index.Manifests {
if !strings.HasPrefix(result.ArtifactType, "application/vnd.dev.sigstore.bundle") {
continue
}
// TODO: We could filter by PredicateType here, but we'd need to thread
// the predicate type from the CLI flag to this function (we could add
// it to CheckOpts perhaps?)
st, err := name.ParseReference(fmt.Sprintf("%s@%s", digest.Repository, result.Digest.String()))
if err != nil {
return nil, nil, err
Expand Down

0 comments on commit 7a4c4df

Please sign in to comment.