cleanup: use NewWithOptions replace the Deprecated one (#21243)

This commit is contained in:
jiuker 2025-04-29 23:35:51 +08:00 committed by GitHub
parent 30a1261c22
commit 9ea14c88d8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -2614,12 +2614,11 @@ func getAdminClient(endpoint, accessKey, secretKey string) (*madmin.AdminClient,
if globalBucketTargetSys.isOffline(epURL) { if globalBucketTargetSys.isOffline(epURL) {
return nil, RemoteTargetConnectionErr{Endpoint: epURL.String(), Err: fmt.Errorf("remote target is offline for endpoint %s", epURL.String())} return nil, RemoteTargetConnectionErr{Endpoint: epURL.String(), Err: fmt.Errorf("remote target is offline for endpoint %s", epURL.String())}
} }
client, err := madmin.New(epURL.Host, accessKey, secretKey, epURL.Scheme == "https") return madmin.NewWithOptions(epURL.Host, &madmin.Options{
if err != nil { Creds: credentials.NewStaticV4(accessKey, secretKey, ""),
return nil, err Secure: epURL.Scheme == "https",
} Transport: globalRemoteTargetTransport,
client.SetCustomTransport(globalRemoteTargetTransport) })
return client, nil
} }
func getS3Client(pc madmin.PeerSite) (*minio.Client, error) { func getS3Client(pc madmin.PeerSite) (*minio.Client, error) {