Skip to content

Commit

Permalink
fix: handle empty trust policies
Browse files Browse the repository at this point in the history
  • Loading branch information
akashsinghal committed May 1, 2024
1 parent a884308 commit 2d9b93a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pkg/verifier/cosign/cosign.go
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,8 @@ func (f *cosignVerifierFactory) Create(_ string, verifierConfig config.VerifierC

var trustPolicies *TrustPolicies
legacy := true
if config.KeyRef == "" && config.RekorURL == "" {
// if trustPolicies are provided and non-legacy, create the trust policies
if config.KeyRef == "" && config.RekorURL == "" && len(config.TrustPolicies) > 0 {
trustPolicies, err = CreateTrustPolicies(config.TrustPolicies, verifierName)
if err != nil {
return nil, err
Expand Down

0 comments on commit 2d9b93a

Please sign in to comment.