Added check for mandatory MINIO_KMS_KES_KEY_NAME env var (#18077)

If MinIO started with KMS enabled, MINIO_KMS_KES_KEY_NAME should
be set for server to start.

Signed-off-by: Shubhendu Ram Tripathi <shubhendu@minio.io>
This commit is contained in:
Shubhendu 2023-09-21 23:07:37 +05:30 committed by GitHub
parent 6a096e7dc7
commit 74cfb207c1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -808,6 +808,9 @@ func handleKMSConfig() {
logger.Fatal(errors.New("ambigious KMS configuration"), fmt.Sprintf("The environment contains %q as well as %q", kms.EnvKESAPIKey, kms.EnvKESClientCert))
}
}
if !env.IsSet(kms.EnvKESKeyName) {
logger.Fatal(errors.New("Invalid KES configuration"), fmt.Sprintf("The mandatory environment variable %q not set", kms.EnvKESKeyName))
}
var endpoints []string
for _, endpoint := range strings.Split(env.Get(kms.EnvKESEndpoint, ""), ",") {