New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
util: set defaults for Vault config before converting #2602
Conversation
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>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
|
/retest ci/centos/mini-e2e/k8s-1.22 |
| @@ -43,7 +43,7 @@ const ( | |||
| vaultDefaultRole = "csi-kubernetes" | |||
| vaultDefaultNamespace = "" | |||
| vaultDefaultPassphrasePath = "" | |||
| vaultDefaultCAVerify = "true" | |||
| vaultDefaultCAVerify = true | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@nixpanic this is bit confusing actually, vaultDefaultCAVerify take it as bool and DestroyKeys with string but in form form of boolean "true". Cant we make it in uniform manner?
When using UPPER_CASE formatting for the HashiCorp Vault KMS
configuration, a missing
VAULT_DESTROY_KEYSwill cause the option tobe set to "false". The default for the option is intended for be "true".
This is a difference in behaviour between the
vaultDestroyKeysandVAULT_DESTROY_KEYSoptions. Both should use a default of "true" whenthe configuration does not set the option explicitly.
By setting the default options in the
standardVaultstruct beforeunmarshalling the configuration in it, the default values will be
retained for the missing configuration options.
Show available bot commands
These commands are normally not required, but in case of issues, leave any of
the following bot commands in an otherwise empty comment in this PR:
/retest ci/centos/<job-name>: retest the<job-name>after unrelatedfailure (please report the failure too!)
/retest all: run this in case the CentOS CI failed to start/report any testprogress or results