Only initialize the KMS config map if env map contains values (#22959)

- This protects against a test in ENT and a use-case in which
   we would force a migration for stored configs that had been
   written with a nil configuration
This commit is contained in:
Steven Clark 2023-09-11 11:22:24 -04:00 committed by GitHub
parent 8b26ac03a5
commit 6fc9905937
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -216,7 +216,7 @@ func configureWrapper(configKMS *KMS, infoKeys *[]string, info *map[string]strin
var err error
envConfig := GetEnvConfigFunc(configKMS)
if configKMS.Config == nil {
if len(envConfig) > 0 && configKMS.Config == nil {
configKMS.Config = make(map[string]string)
}
// transit is a special case, because some config values take precedence over env vars