mirror of
https://github.com/minio/minio.git
synced 2025-01-11 15:03:22 -05:00
Write deployment id to health report at the start (#14673)
The deployment id was being written to the health report towards the end of the handler. Because of this, if there was a timeout in any of the data fetching, the deployment id was not getting written at all. Upload of such reports fails on SUBNET as deployment id is the unique identifier for a cluster in subnet. Fixed by writing the deployment id at the beginning of the processing.
This commit is contained in:
parent
165d60421d
commit
7c696e1cb6
@ -1663,7 +1663,14 @@ func (a adminAPIHandlers) HealthInfoHandler(w http.ResponseWriter, r *http.Reque
|
||||
}
|
||||
|
||||
query := r.Form
|
||||
healthInfo := madmin.HealthInfo{Version: madmin.HealthInfoVersion}
|
||||
healthInfo := madmin.HealthInfo{
|
||||
Version: madmin.HealthInfoVersion,
|
||||
Minio: madmin.MinioHealthInfo{
|
||||
Info: madmin.MinioInfo{
|
||||
DeploymentID: globalDeploymentID,
|
||||
},
|
||||
},
|
||||
}
|
||||
healthInfoCh := make(chan madmin.HealthInfo)
|
||||
|
||||
enc := json.NewEncoder(w)
|
||||
@ -1999,7 +2006,7 @@ func (a adminAPIHandlers) HealthInfoHandler(w http.ResponseWriter, r *http.Reque
|
||||
go func() {
|
||||
defer close(healthInfoCh)
|
||||
|
||||
partialWrite(healthInfo) // Write first message with only version populated
|
||||
partialWrite(healthInfo) // Write first message with only version and deployment id populated
|
||||
getAndWriteCPUs()
|
||||
getAndWritePartitions()
|
||||
getAndWriteOSInfo()
|
||||
|
Loading…
Reference in New Issue
Block a user