mirror of
https://github.com/minio/minio.git
synced 2025-01-25 21:53:16 -05:00
gcs: Better parsing of address flag (#4709)
This commit is contained in:
parent
eb787d8613
commit
b918a6592f
@ -293,6 +293,12 @@ func gatewayMain(ctx *cli.Context, backendType gatewayBackend) {
|
|||||||
log.EnableQuiet()
|
log.EnableQuiet()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Fetch address option
|
||||||
|
gatewayAddr := ctx.GlobalString("address")
|
||||||
|
if gatewayAddr == ":"+globalMinioPort {
|
||||||
|
gatewayAddr = ctx.String("address")
|
||||||
|
}
|
||||||
|
|
||||||
// Handle common command args.
|
// Handle common command args.
|
||||||
handleCommonCmdArgs(ctx)
|
handleCommonCmdArgs(ctx)
|
||||||
|
|
||||||
@ -363,7 +369,7 @@ func gatewayMain(ctx *cli.Context, backendType gatewayBackend) {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
globalHTTPServer = miniohttp.NewServer([]string{ctx.GlobalString("address")}, registerHandlers(router, handlerFns...), globalTLSCertificate)
|
globalHTTPServer = miniohttp.NewServer([]string{gatewayAddr}, registerHandlers(router, handlerFns...), globalTLSCertificate)
|
||||||
|
|
||||||
// Start server, automatically configures TLS if certs are available.
|
// Start server, automatically configures TLS if certs are available.
|
||||||
go func() {
|
go func() {
|
||||||
@ -393,7 +399,7 @@ func gatewayMain(ctx *cli.Context, backendType gatewayBackend) {
|
|||||||
checkUpdate(mode)
|
checkUpdate(mode)
|
||||||
|
|
||||||
// Print gateway startup message.
|
// Print gateway startup message.
|
||||||
printGatewayStartupMessage(getAPIEndpoints(ctx.String("address")), backendType)
|
printGatewayStartupMessage(getAPIEndpoints(gatewayAddr), backendType)
|
||||||
}
|
}
|
||||||
|
|
||||||
handleSignals()
|
handleSignals()
|
||||||
|
@ -31,7 +31,7 @@ import (
|
|||||||
var serverFlags = []cli.Flag{
|
var serverFlags = []cli.Flag{
|
||||||
cli.StringFlag{
|
cli.StringFlag{
|
||||||
Name: "address",
|
Name: "address",
|
||||||
Value: ":9000",
|
Value: ":" + globalMinioPort,
|
||||||
Usage: "Bind to a specific ADDRESS:PORT, ADDRESS can be an IP or hostname.",
|
Usage: "Bind to a specific ADDRESS:PORT, ADDRESS can be an IP or hostname.",
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user