mirror of
https://github.com/minio/minio.git
synced 2025-11-20 18:06:10 -05:00
fix: allow dynamic ports for API only in non-distributed setups (#18019)
fixes #17998
This commit is contained in:
@@ -255,6 +255,16 @@ func serverHandleCmdArgs(ctx *cli.Context) {
|
||||
logger.FatalIf(err, "Invalid command line arguments")
|
||||
globalNodes = globalEndpoints.GetNodes()
|
||||
|
||||
globalIsErasure = (setupType == ErasureSetupType)
|
||||
globalIsDistErasure = (setupType == DistErasureSetupType)
|
||||
if globalIsDistErasure {
|
||||
globalIsErasure = true
|
||||
}
|
||||
globalIsErasureSD = (setupType == ErasureSDSetupType)
|
||||
if globalDynamicAPIPort && globalIsDistErasure {
|
||||
logger.FatalIf(errInvalidArgument, "Invalid --address=\"%s\", port '0' is not allowed in a distributed erasure coded setup", ctx.String("address"))
|
||||
}
|
||||
|
||||
globalLocalNodeName = GetLocalPeer(globalEndpoints, globalMinioHost, globalMinioPort)
|
||||
nodeNameSum := sha256.Sum256([]byte(globalLocalNodeName))
|
||||
globalLocalNodeNameHex = hex.EncodeToString(nodeNameSum[:])
|
||||
@@ -289,13 +299,6 @@ func serverHandleCmdArgs(ctx *cli.Context) {
|
||||
// To avoid this error situation we check for port availability.
|
||||
logger.FatalIf(xhttp.CheckPortAvailability(globalMinioHost, globalMinioPort, globalTCPOptions), "Unable to start the server")
|
||||
|
||||
globalIsErasure = (setupType == ErasureSetupType)
|
||||
globalIsDistErasure = (setupType == DistErasureSetupType)
|
||||
if globalIsDistErasure {
|
||||
globalIsErasure = true
|
||||
}
|
||||
globalIsErasureSD = (setupType == ErasureSDSetupType)
|
||||
|
||||
globalConnReadDeadline = ctx.Duration("conn-read-deadline")
|
||||
globalConnWriteDeadline = ctx.Duration("conn-write-deadline")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user