From 9ee49f97bdd3fa79eb4adfa9c456b236647d17f9 Mon Sep 17 00:00:00 2001 From: akashsinghal Date: Tue, 26 Mar 2024 01:39:42 +0000 Subject: [PATCH] add logging for missing certs in KMP --- pkg/verifier/notation/truststore.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkg/verifier/notation/truststore.go b/pkg/verifier/notation/truststore.go index 0acb7d4ad..cf7373cef 100644 --- a/pkg/verifier/notation/truststore.go +++ b/pkg/verifier/notation/truststore.go @@ -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...)