mirror of
https://github.com/ceph/ceph-csi.git
synced 2025-06-13 10:33:35 +00:00
util: set defaults for Vault config before converting
When using UPPER_CASE formatting for the HashiCorp Vault KMS configuration, a missing `VAULT_DESTROY_KEYS` will cause the option to be set to "false". The default for the option is intended for be "true". This is a difference in behaviour between the `vaultDestroyKeys` and `VAULT_DESTROY_KEYS` options. Both should use a default of "true" when the configuration does not set the option explicitly. By setting the default options in the `standardVault` struct before unmarshalling the configuration in it, the default values will be retained for the missing configuration options. Reported-by: Rachael George <rgeorge@redhat.com> Signed-off-by: Niels de Vos <ndevos@redhat.com>
This commit is contained in:
committed by
mergify[bot]
parent
de57fa1804
commit
c852f487a5
@ -43,7 +43,7 @@ const (
|
||||
vaultDefaultRole = "csi-kubernetes"
|
||||
vaultDefaultNamespace = ""
|
||||
vaultDefaultPassphrasePath = ""
|
||||
vaultDefaultCAVerify = "true"
|
||||
vaultDefaultCAVerify = true
|
||||
vaultDefaultDestroyKeys = "true"
|
||||
)
|
||||
|
||||
@ -208,7 +208,7 @@ func (vc *vaultConnection) initConnection(config map[string]interface{}) error {
|
||||
keyContext[loss.KeyVaultNamespace] = vaultNamespace
|
||||
}
|
||||
|
||||
verifyCA := vaultDefaultCAVerify // optional
|
||||
verifyCA := strconv.FormatBool(vaultDefaultCAVerify) // optional
|
||||
err = setConfigString(&verifyCA, config, "vaultCAVerify")
|
||||
if errors.Is(err, errConfigOptionInvalid) {
|
||||
return err
|
||||
|
Reference in New Issue
Block a user