mirror of
https://github.com/pgsty/minio.git
synced 2026-07-21 21:20:23 +03:00
fix: allow dynamic ports for API only in non-distributed setups (#18019)
fixes #17998
This commit is contained in:
+10
-1
@@ -391,7 +391,7 @@ func handleCommonCmdArgs(ctx *cli.Context) {
|
||||
if consoleAddr == "" {
|
||||
p, err := xnet.GetFreePort()
|
||||
if err != nil {
|
||||
logger.FatalIf(err, "Unable to get free port for console on the host")
|
||||
logger.FatalIf(err, "Unable to get free port for Console UI on the host")
|
||||
}
|
||||
consoleAddr = net.JoinHostPort("", p.String())
|
||||
}
|
||||
@@ -405,6 +405,15 @@ func handleCommonCmdArgs(ctx *cli.Context) {
|
||||
}
|
||||
|
||||
globalMinioHost, globalMinioPort = mustSplitHostPort(addr)
|
||||
if globalMinioPort == "0" {
|
||||
p, err := xnet.GetFreePort()
|
||||
if err != nil {
|
||||
logger.FatalIf(err, "Unable to get free port for S3 API on the host")
|
||||
}
|
||||
globalMinioPort = p.String()
|
||||
globalDynamicAPIPort = true
|
||||
}
|
||||
|
||||
globalMinioConsoleHost, globalMinioConsolePort = mustSplitHostPort(consoleAddr)
|
||||
|
||||
if globalMinioPort == globalMinioConsolePort {
|
||||
|
||||
Reference in New Issue
Block a user