Skip to content

Commit 2c72624

Browse files
committed
Return error if no bundles exist in registry
Signed-off-by: Cody Soyland <[email protected]>
1 parent c0289f3 commit 2c72624

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

pkg/cosign/verify.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1551,6 +1551,12 @@ func getBundles(_ context.Context, signedImgRef name.Reference, co *CheckOpts) (
15511551
bundles = append(bundles, bundle)
15521552
}
15531553

1554+
if len(bundles) == 0 {
1555+
return nil, nil, &ErrNoMatchingAttestations{
1556+
fmt.Errorf("no valid bundles exist in registry"),
1557+
}
1558+
}
1559+
15541560
return bundles, &h, nil
15551561
}
15561562

0 commit comments

Comments
 (0)