From db15458d16149512a3d2c7de84c9bdd5b0e734ff Mon Sep 17 00:00:00 2001 From: Niels de Vos Date: Mon, 14 Dec 2020 11:26:31 +0100 Subject: [PATCH] cleanup: use constant for "vault" KMS-type Signed-off-by: Niels de Vos --- internal/util/crypto.go | 2 +- internal/util/vault.go | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/internal/util/crypto.go b/internal/util/crypto.go index 8e1f6af35..7b0c61e70 100644 --- a/internal/util/crypto.go +++ b/internal/util/crypto.go @@ -138,7 +138,7 @@ func GetKMS(tenant, kmsID string, secrets map[string]string) (EncryptionKMS, err } switch kmsType { - case "vault": + case kmsTypeVault: return InitVaultKMS(kmsID, kmsConfig, secrets) case kmsTypeVaultTokens: return InitVaultTokensKMS(tenant, kmsID, kmsConfig, secrets) diff --git a/internal/util/vault.go b/internal/util/vault.go index fca1f3b6f..ec08df756 100644 --- a/internal/util/vault.go +++ b/internal/util/vault.go @@ -31,6 +31,8 @@ import ( ) const ( + kmsTypeVault = "vault" + // path to service account token that will be used to authenticate with Vault // #nosec serviceAccountTokenPath = "/var/run/secrets/kubernetes.io/serviceaccount/token"