Skip to content

Commit

Permalink
add logging for missing certs in KMP
Browse files Browse the repository at this point in the history
  • Loading branch information
akashsinghal committed Mar 26, 2024
1 parent 5dd6d5c commit 9ee49f9
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pkg/verifier/notation/truststore.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,13 @@ func (s trustStore) getCertificatesInternal(ctx context.Context, namedStore stri
result := keymanagementprovider.FlattenKMPMap(keymanagementprovider.GetCertificatesFromMap(certStore))
// notation verifier does not consider specific named/versioned certificates within a key management provider resource
if len(result) == 0 {
logger.GetLogger(ctx, logOpt).Warnf("no certificate fetched for Key Management Provider %+v", certStore)
// check certificate store if key management provider does not have certificates.
// NOTE: certificate store and key management provider should not be configured together.
// User will be warned by the controller/CLI
result = certificatesMap[certStore]
if len(result) == 0 {
logger.GetLogger(ctx, logOpt).Warnf("no certificate fetched for certStore %+v", certStore)
logger.GetLogger(ctx, logOpt).Warnf("no certificate fetched for Certificate Store %+v", certStore)
}
}
certs = append(certs, result...)
Expand Down

0 comments on commit 9ee49f9

Please sign in to comment.