Set Deployment ID before starting handlers (#9635)

Global handler ID is added to response headers, so initialize it before the server starts.

Fixes #9634
master
Klaus Post 5 years ago committed by GitHub
parent 1bc32215b9
commit 1847f17f50
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 7
      cmd/gateway-main.go

@ -96,6 +96,10 @@ func ValidateGatewayArguments(serverAddr, endpointAddr string) error {
// StartGateway - handler for 'minio gateway <name>'.
func StartGateway(ctx *cli.Context, gw Gateway) {
// This is only to uniquely identify each gateway deployments.
globalDeploymentID = env.Get("MINIO_GATEWAY_DEPLOYMENT_ID", mustGetUUID())
logger.SetDeploymentID(globalDeploymentID)
if gw == nil {
logger.FatalIf(errUnexpected, "Gateway implementation not initialized")
}
@ -260,9 +264,6 @@ func StartGateway(ctx *cli.Context, gw Gateway) {
// is only enabled for "NAS" gateway.
globalConfigSys.WatchConfigNASDisk(GlobalContext, newObject)
}
// This is only to uniquely identify each gateway deployments.
globalDeploymentID = env.Get("MINIO_GATEWAY_DEPLOYMENT_ID", mustGetUUID())
logger.SetDeploymentID(globalDeploymentID)
if globalEtcdClient != nil {
// **** WARNING ****

Loading…
Cancel
Save