Skip to content

Commit

Permalink
chore: update err-msg with notation (#1775)
Browse files Browse the repository at this point in the history
Co-authored-by: Binbin Li <[email protected]>
  • Loading branch information
junczhu and binbin-li authored Sep 5, 2024
1 parent 6487002 commit 7208f98
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/verifier/notation/notation.go
Original file line number Diff line number Diff line change
Expand Up @@ -254,11 +254,11 @@ func normalizeVerificationCertsStores(conf *NotationPluginVerifierConfig) error
func normalizeLegacyCertStore(conf *NotationPluginVerifierConfig) (map[string]interface{}, error) {
legacyCertStoreBytes, err := json.Marshal(conf.VerificationCertStores)
if err != nil {
return nil, re.ErrorCodeConfigInvalid.NewError(re.Verifier, conf.Name, re.EmptyLink, err, nil, re.HideStackTrace)
return nil, re.ErrorCodeConfigInvalid.WithDetail(fmt.Sprintf("Failed to recognize `verificationCertStores` value of Notation Verifier configuration: %+v", conf.VerificationCertStores)).WithError(err)
}
var legacyCertStore map[string]interface{}
if err := json.Unmarshal(legacyCertStoreBytes, &legacyCertStore); err != nil {
return nil, re.ErrorCodeConfigInvalid.NewError(re.Verifier, conf.Name, re.EmptyLink, err, fmt.Sprintf("failed to unmarshal to legacyCertStore from: %+v.", legacyCertStoreBytes), re.HideStackTrace)
return nil, re.ErrorCodeConfigInvalid.WithDetail(fmt.Sprintf("Failed to recognize `verificationCertStores` value of Notation Verifier configuration: %+v", conf.VerificationCertStores)).WithError(err)

Check warning on line 261 in pkg/verifier/notation/notation.go

View check run for this annotation

Codecov / codecov/patch

pkg/verifier/notation/notation.go#L261

Added line #L261 was not covered by tests
}
return legacyCertStore, nil
}

0 comments on commit 7208f98

Please sign in to comment.