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
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

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