Skip to content

Commit

Permalink
mod: reuse isEnabled
Browse files Browse the repository at this point in the history
Signed-off-by: Joshua Duffney <[email protected]>
  • Loading branch information
duffney committed Oct 28, 2024
1 parent 75ade00 commit 44141c6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/keymanagementprovider/azurekeyvault/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)

Expand Down

0 comments on commit 44141c6

Please sign in to comment.