cleanup: use vaultDefaultCAVerify to set default value

Golang-ci complains about the following:

    internal/util/vault_tokens.go:99:20: string `true` has 4 occurrences, but such constant `vaultDefaultDestroyKeys` already exists (goconst)
    	v.VaultCAVerify = "true"
    	                  ^

This occurence of "true" can be replaced by vaultDefaultCAVerify so
address the warning.

Signed-off-by: Niels de Vos <ndevos@redhat.com>
This commit is contained in:
Niels de Vos 2021-08-02 11:35:26 +02:00 committed by mergify[bot]
parent f584db41e6
commit b5d2321d57

View File

@ -99,7 +99,7 @@ func (v *vaultTokenConf) convertStdVaultToCSIConfig(s *standardVault) {
// by default the CA should get verified, only when VaultSkipVerify is // by default the CA should get verified, only when VaultSkipVerify is
// set, verification should be disabled // set, verification should be disabled
v.VaultCAVerify = "true" v.VaultCAVerify = vaultDefaultCAVerify
verify, err := strconv.ParseBool(s.VaultSkipVerify) verify, err := strconv.ParseBool(s.VaultSkipVerify)
if err == nil { if err == nil {
v.VaultCAVerify = strconv.FormatBool(!verify) v.VaultCAVerify = strconv.FormatBool(!verify)