Use constants for gateway names to avoid bugs caused by spelling. (#10355)

This commit is contained in:
飞雪无情
2020-08-26 23:52:46 +08:00
committed by GitHub
parent ea5094e842
commit ea1803417f
9 changed files with 31 additions and 37 deletions

View File

@@ -157,7 +157,7 @@ func healingMetricsPrometheus(ch chan<- prometheus.Metric) {
// collects gateway specific metrics for MinIO instance in Prometheus specific format
// and sends to given channel
func gatewayMetricsPrometheus(ch chan<- prometheus.Metric) {
if !globalIsGateway || (globalGatewayName != "s3" && globalGatewayName != "azure" && globalGatewayName != "gcs") {
if !globalIsGateway || (globalGatewayName != S3BackendGateway && globalGatewayName != AzureBackendGateway && globalGatewayName != GCSBackendGateway) {
return
}