Check for address flags in all positions (#9615)

Fixes #9599
This commit is contained in:
kannappanr
2020-05-17 08:46:23 -07:00
committed by GitHub
parent 011a2c0b78
commit a62572fb86
5 changed files with 16 additions and 7 deletions

View File

@@ -130,8 +130,13 @@ func isAzureMarker(marker string) bool {
func azureGatewayMain(ctx *cli.Context) {
// Validate gateway arguments.
host := ctx.Args().First()
serverAddr := ctx.GlobalString("address")
if serverAddr == "" || serverAddr == ":"+minio.GlobalMinioDefaultPort {
serverAddr = ctx.String("address")
}
// Validate gateway arguments.
logger.FatalIf(minio.ValidateGatewayArguments(ctx.GlobalString("address"), host), "Invalid argument")
logger.FatalIf(minio.ValidateGatewayArguments(serverAddr, host), "Invalid argument")
minio.StartGateway(ctx, &Azure{host})
}