fix: gcs tier going offline due to customer HTTPclient (#19973)

specifying customer HTTP client makes the gcs SDK
ignore the passed credentials, instead let the GCS
SDK manage the transport.

this PR fixes #19922 a regression from #19565
This commit is contained in:
Harshavardhana
2024-06-21 22:26:45 -07:00
committed by GitHub
parent 4d7d008741
commit be97ae4c5d

View File

@@ -22,7 +22,6 @@ import (
"errors"
"fmt"
"io"
"net/http"
"cloud.google.com/go/storage"
"github.com/minio/madmin-go/v3"
@@ -118,14 +117,9 @@ func newWarmBackendGCS(conf madmin.TierGCS, tier string) (*warmBackendGCS, error
return nil, err
}
clnt := &http.Client{
Transport: globalRemoteTargetTransport,
}
client, err := storage.NewClient(context.Background(),
option.WithCredentialsJSON(credsJSON),
option.WithScopes(storage.ScopeReadWrite),
option.WithHTTPClient(clnt),
option.WithUserAgent(fmt.Sprintf("gcs-tier-%s", tier)+SlashSeparator+ReleaseTag),
)
if err != nil {