Send deployment id and minio version in http header (#14378)
This commit is contained in:
@@ -191,3 +191,9 @@ const (
|
||||
|
||||
UploadID = "uploadId"
|
||||
)
|
||||
|
||||
// http headers sent to webhook targets
|
||||
const (
|
||||
// Reports the version of MinIO server
|
||||
MinIOVersion = "x-minio-version"
|
||||
)
|
||||
|
||||
@@ -33,6 +33,14 @@ import (
|
||||
humanize "github.com/dustin/go-humanize"
|
||||
)
|
||||
|
||||
var (
|
||||
// GlobalMinIOVersion - is sent in the header to all http targets
|
||||
GlobalMinIOVersion string
|
||||
|
||||
// GlobalDeploymentID - is sent in the header to all http targets
|
||||
GlobalDeploymentID string
|
||||
)
|
||||
|
||||
const (
|
||||
serverShutdownPoll = 500 * time.Millisecond
|
||||
|
||||
@@ -196,3 +204,13 @@ func NewServer(addrs []string) *Server {
|
||||
httpServer.MaxHeaderBytes = DefaultMaxHeaderBytes
|
||||
return httpServer
|
||||
}
|
||||
|
||||
// SetMinIOVersion -- MinIO version from the main package is set here
|
||||
func SetMinIOVersion(minioVer string) {
|
||||
GlobalMinIOVersion = minioVer
|
||||
}
|
||||
|
||||
// SetDeploymentID -- Deployment Id from the main package is set here
|
||||
func SetDeploymentID(deploymentID string) {
|
||||
GlobalDeploymentID = deploymentID
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user