fix MINIO_KMS_SECRET_KEY env. variable parsing (#12200)

This commit fixes a bug when parsing the env. variable
`MINIO_KMS_SECRET_KEY`. Before, the env. variable
name - instead of its value - was parsed. This (obviously)
did not work properly.

This commit fixes this.

Signed-off-by: Andreas Auernhammer <aead@mail.de>
This commit is contained in:
Andreas Auernhammer
2021-05-01 03:47:30 +02:00
committed by GitHub
parent 0d3ddf7286
commit 4815f92fa8
3 changed files with 28 additions and 33 deletions

View File

@@ -340,7 +340,7 @@ func handleCommonEnvVars() {
}
if env.IsSet(config.EnvKMSSecretKey) {
GlobalKMS, err = kms.Parse(config.EnvKMSSecretKey)
GlobalKMS, err = kms.Parse(env.Get(config.EnvKMSSecretKey, ""))
if err != nil {
logger.Fatal(err, "Unable to parse the KMS secret key inherited from the shell environment")
}