From 74cfb207c1974e8824fd50ff3a60264a3e1d49bc Mon Sep 17 00:00:00 2001 From: Shubhendu Date: Thu, 21 Sep 2023 23:07:37 +0530 Subject: [PATCH] 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 --- cmd/common-main.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cmd/common-main.go b/cmd/common-main.go index 6d295c00e..12c68b375 100644 --- a/cmd/common-main.go +++ b/cmd/common-main.go @@ -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, ""), ",") {