diff --git a/cmd/common-main.go b/cmd/common-main.go index 3adc2fc68..440928f42 100644 --- a/cmd/common-main.go +++ b/cmd/common-main.go @@ -967,7 +967,7 @@ func handleKMSConfig() { // We don't treat a policy error as failure condition since MinIO may not have the permission // to create keys - just to generate/decrypt data encryption keys. if _, err = KMS.GenerateKey(GlobalContext, env.Get(kms.EnvKESKeyName, ""), kms.Context{}); err != nil && errors.Is(err, kes.ErrKeyNotFound) { - if err = KMS.CreateKey(context.Background(), env.Get(kms.EnvKESKeyName, "")); err != nil && !errors.Is(err, kes.ErrKeyExists) && !errors.Is(err, kes.ErrNotAllowed) { + if err = KMS.CreateKey(GlobalContext, env.Get(kms.EnvKESKeyName, "")); err != nil && !errors.Is(err, kes.ErrKeyExists) && !errors.Is(err, kes.ErrNotAllowed) { logger.Fatal(err, "Unable to initialize a connection to KES as specified by the shell environment") } }