mirror of
https://github.com/minio/minio.git
synced 2025-11-06 20:33:07 -05:00
fix: log errors for incorrect environment inputs (#13121)
Invalid MINIO_ARGS, MINIO_ENDPOINTS would be silently ignored when using remoteEnv style, make sure to log errors to indicate invalid configuration.
This commit is contained in:
@@ -105,10 +105,18 @@ EXAMPLES:
|
||||
}
|
||||
|
||||
func serverCmdArgs(ctx *cli.Context) []string {
|
||||
v := env.Get(config.EnvArgs, "")
|
||||
v, _, _, err := env.LookupEnv(config.EnvArgs)
|
||||
if err != nil {
|
||||
logger.FatalIf(err, "Unable to validate passed arguments in %s:%s",
|
||||
config.EnvArgs, os.Getenv(config.EnvArgs))
|
||||
}
|
||||
if v == "" {
|
||||
// Fall back to older ENV MINIO_ENDPOINTS
|
||||
v = env.Get(config.EnvEndpoints, "")
|
||||
// Fall back to older environment value MINIO_ENDPOINTS
|
||||
v, _, _, err = env.LookupEnv(config.EnvEndpoints)
|
||||
if err != nil {
|
||||
logger.FatalIf(err, "Unable to validate passed arguments in %s:%s",
|
||||
config.EnvEndpoints, os.Getenv(config.EnvEndpoints))
|
||||
}
|
||||
}
|
||||
if v == "" {
|
||||
if !ctx.Args().Present() || ctx.Args().First() == "help" {
|
||||
|
||||
Reference in New Issue
Block a user