From 95b8f240cfab366079f704e8080bf65d2e14ac02 Mon Sep 17 00:00:00 2001 From: Jorge Turrado Ferrero Date: Mon, 5 Aug 2024 15:22:39 +0200 Subject: [PATCH] fix: Hashicorp Vault PKI doesn't fail with due to KeyPair mismatch (#6029) Signed-off-by: Jorge Turrado Signed-off-by: michael pechner --- CHANGELOG.md | 2 +- pkg/scaling/resolver/hashicorpvault_handler.go | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 35d08a5e413..866ec661a6e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -71,7 +71,7 @@ Here is an overview of all new **experimental** features: ### Fixes -- TODO ([#XXX](https://github.com/kedacore/keda/issues/XXX)) +- **General**: Hashicorp Vault PKI doesn't fail with due to KeyPair mismatch ([#6028](https://github.com/kedacore/keda/issues/6028)) ### Deprecations diff --git a/pkg/scaling/resolver/hashicorpvault_handler.go b/pkg/scaling/resolver/hashicorpvault_handler.go index 1781a204413..e80b7302cda 100644 --- a/pkg/scaling/resolver/hashicorpvault_handler.go +++ b/pkg/scaling/resolver/hashicorpvault_handler.go @@ -277,7 +277,7 @@ func (vh *HashicorpVaultHandler) getSecretValue(secret *kedav1alpha1.VaultSecret type SecretGroup struct { path string secretType kedav1alpha1.VaultSecretType - vaultPkiData *kedav1alpha1.VaultPkiData + vaultPkiData kedav1alpha1.VaultPkiData } // fetchSecret returns the vaultSecret at a given vault path. If the secret is a pki, then the secret will use the @@ -314,7 +314,7 @@ func (vh *HashicorpVaultHandler) ResolveSecrets(secrets []kedav1alpha1.VaultSecr grouped := make(map[SecretGroup][]kedav1alpha1.VaultSecret) vaultSecrets := make(map[SecretGroup]*vaultapi.Secret) for _, e := range secrets { - group := SecretGroup{secretType: e.Type, path: e.Path, vaultPkiData: &e.PkiData} + group := SecretGroup{secretType: e.Type, path: e.Path, vaultPkiData: e.PkiData} if _, ok := grouped[group]; !ok { grouped[group] = make([]kedav1alpha1.VaultSecret, 0) } @@ -322,7 +322,7 @@ func (vh *HashicorpVaultHandler) ResolveSecrets(secrets []kedav1alpha1.VaultSecr } // For each group fetch the secret from vault for group := range grouped { - vaultSecret, err := vh.fetchSecret(group.secretType, group.path, group.vaultPkiData) + vaultSecret, err := vh.fetchSecret(group.secretType, group.path, &group.vaultPkiData) if err != nil { // could not fetch secret, skipping group continue