mirror of
https://github.com/minio/minio.git
synced 2025-04-07 21:25:36 -04:00
Validate replication target update to avoid duplicate endpoints (#16311)
This commit is contained in:
parent
44250f1a52
commit
8528b265a9
@ -228,8 +228,10 @@ func (a adminAPIHandlers) SetRemoteTargetHandler(w http.ResponseWriter, r *http.
|
|||||||
for _, op := range ops {
|
for _, op := range ops {
|
||||||
switch op {
|
switch op {
|
||||||
case madmin.CredentialsUpdateType:
|
case madmin.CredentialsUpdateType:
|
||||||
|
if !globalSiteReplicationSys.isEnabled() {
|
||||||
tgt.Credentials = target.Credentials
|
tgt.Credentials = target.Credentials
|
||||||
tgt.TargetBucket = target.TargetBucket
|
tgt.TargetBucket = target.TargetBucket
|
||||||
|
}
|
||||||
tgt.Secure = target.Secure
|
tgt.Secure = target.Secure
|
||||||
tgt.Endpoint = target.Endpoint
|
tgt.Endpoint = target.Endpoint
|
||||||
case madmin.SyncUpdateType:
|
case madmin.SyncUpdateType:
|
||||||
|
@ -256,6 +256,10 @@ func (sys *BucketTargetSys) SetTarget(ctx context.Context, bucket string, tgt *m
|
|||||||
found = true
|
found = true
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
// fail if endpoint is already present in list of targets and not a matching ARN
|
||||||
|
if t.Endpoint == tgt.Endpoint {
|
||||||
|
return BucketRemoteAlreadyExists{Bucket: t.TargetBucket}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
newtgts[idx] = t
|
newtgts[idx] = t
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user