Skip to content

Commit

Permalink
fix: showing verifier config parse detail in err log (ratify-project#…
Browse files Browse the repository at this point in the history
…1791)

Signed-off-by: akashsinghal <[email protected]>
  • Loading branch information
junczhu authored and akashsinghal committed Sep 13, 2024
1 parent 9c6831c commit 076c9ca
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion pkg/verifier/notation/notation.go
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,10 @@ func normalizeVerificationCertsStores(conf *NotationPluginVerifierConfig) error
}
}
if isCertStoresByType && isLegacyCertStore {
return re.ErrorCodeConfigInvalid.WithDetail("The verificationCertStores is misconfigured with both legacy and new formats").WithRemediation("Please provide only one format for the VerificationCertStores. Refer to the Notation Verifier configuration guide: https://ratify.dev/docs/plugins/verifier/notation#configuration")
// showing configuration content in the log with error details for better user experience
err := re.ErrorCodeConfigInvalid.WithDetail(fmt.Sprintf("The verificationCertStores is misconfigured with both legacy and new formats: %+v", conf)).WithRemediation("Please provide only one format for the VerificationCertStores. Refer to the Notation Verifier configuration guide: https://ratify.dev/docs/plugins/verifier/notation#configuration")
logger.GetLogger(context.Background(), logOpt).Error(err)
return err
} else if !isCertStoresByType && isLegacyCertStore {
legacyCertStore, err := normalizeLegacyCertStore(conf)
if err != nil {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ spec:
verificationCertStores:
ca:
ca-certs:
- certstore-inline
- certstore-inline
trustPolicyDoc:
version: "1.0"
trustPolicies:
Expand Down

0 comments on commit 076c9ca

Please sign in to comment.