fix: handle invalid endpoint errors in site replication(#15499)

fixes #15497
This commit is contained in:
Poorna 2022-08-08 11:12:05 -07:00 committed by GitHub
parent 1d35f2b58f
commit 2c137c0d04
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2210,7 +2210,10 @@ func (c *SiteReplicationSys) RemoveRemoteTargetsForEndpoint(ctx context.Context,
// Other helpers
func getAdminClient(endpoint, accessKey, secretKey string) (*madmin.AdminClient, error) {
epURL, _ := url.Parse(endpoint)
epURL, err := url.Parse(endpoint)
if err != nil {
return nil, err
}
client, err := madmin.New(epURL.Host, accessKey, secretKey, epURL.Scheme == "https")
if err != nil {
return nil, err