fix: check for gateway backend online without http request (#10924)

fixes #10921
This commit is contained in:
Harshavardhana
2020-11-19 10:38:02 -08:00
committed by GitHub
parent d778d9493f
commit 0f9e125cf3
4 changed files with 20 additions and 18 deletions

View File

@@ -276,7 +276,11 @@ func (l *s3Objects) Shutdown(ctx context.Context) error {
// StorageInfo is not relevant to S3 backend.
func (l *s3Objects) StorageInfo(ctx context.Context, _ bool) (si minio.StorageInfo, _ []error) {
si.Backend.Type = minio.BackendGateway
si.Backend.GatewayOnline = minio.IsBackendOnline(ctx, l.HTTPClient, l.Client.EndpointURL().String())
host := l.Client.EndpointURL().Host
if l.Client.EndpointURL().Port() == "" {
host = l.Client.EndpointURL().Host + ":" + l.Client.EndpointURL().Scheme
}
si.Backend.GatewayOnline = minio.IsBackendOnline(ctx, host)
return si, nil
}