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) {
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")
if err != nil {
return nil, err
}
client.SetCustomTransport(globalRemoteTargetTransport)
return client, nil
return madmin.NewWithOptions(epURL.Host, &madmin.Options{
Creds: credentials.NewStaticV4(accessKey, secretKey, ""),
Secure: epURL.Scheme == "https",
Transport: globalRemoteTargetTransport,
})
}
func getS3Client(pc madmin.PeerSite) (*minio.Client, error) {