From 44141c6058cc0027f2592e9ab92d999d8d3b82ab Mon Sep 17 00:00:00 2001 From: Joshua Duffney Date: Mon, 28 Oct 2024 16:08:41 -0500 Subject: [PATCH] mod: reuse isEnabled Signed-off-by: Joshua Duffney --- pkg/keymanagementprovider/azurekeyvault/provider.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/keymanagementprovider/azurekeyvault/provider.go b/pkg/keymanagementprovider/azurekeyvault/provider.go index cfdc48cbf..daf611f56 100644 --- a/pkg/keymanagementprovider/azurekeyvault/provider.go +++ b/pkg/keymanagementprovider/azurekeyvault/provider.go @@ -171,7 +171,7 @@ func (s *akvKMProvider) GetCertificates(ctx context.Context) (map[keymanagementp // if version is set as "" in the config, use the version from the cert bundle keyVaultCert.Version = getObjectVersion(*certBundle.Kid) - if !*certBundle.Attributes.Enabled { + if !isEnabled { logger.GetLogger(ctx, logOpt).Debugf("debug: certificate %s version %s is disabled.", keyVaultCert.Name, keyVaultCert.Version) isEnabled := false @@ -223,7 +223,7 @@ func (s *akvKMProvider) GetKeys(ctx context.Context) (map[keymanagementprovider. // if version is set as "" in the config, use the version from the key bundle keyVaultKey.Version = getObjectVersion(*keyBundle.Key.Kid) - if keyBundle.Attributes != nil && keyBundle.Attributes.Enabled != nil && !*keyBundle.Attributes.Enabled { + if !isEnabled { startTime := time.Now() lastRefreshed := startTime.Format(time.RFC3339)