mirror of
https://github.com/minio/minio.git
synced 2025-04-28 21:58:01 -04:00
sr: add validation to disallow updating bandwidth limit on self (#19062)
This commit is contained in:
parent
7405760f44
commit
f9dbf41e27
@ -3980,6 +3980,9 @@ func (c *SiteReplicationSys) EditPeerCluster(ctx context.Context, peer madmin.Pe
|
|||||||
}
|
}
|
||||||
|
|
||||||
if peer.DefaultBandwidth.IsSet {
|
if peer.DefaultBandwidth.IsSet {
|
||||||
|
if peer.DeploymentID == globalDeploymentID() {
|
||||||
|
return madmin.ReplicateEditStatus{}, errSRInvalidRequest(fmt.Errorf("invalid deployment id specified: expecting a peer deployment-id to be specified for restricting bandwidth from %s, found self %s", peer.Name, globalDeploymentID()))
|
||||||
|
}
|
||||||
pi.DefaultBandwidth = peer.DefaultBandwidth
|
pi.DefaultBandwidth = peer.DefaultBandwidth
|
||||||
pi.DefaultBandwidth.UpdatedAt = UTCNow()
|
pi.DefaultBandwidth.UpdatedAt = UTCNow()
|
||||||
successMsg = fmt.Sprintf("%s\n- default bandwidth %v for peer %s", successMsg, peer.DefaultBandwidth.Limit, peer.Name)
|
successMsg = fmt.Sprintf("%s\n- default bandwidth %v for peer %s", successMsg, peer.DefaultBandwidth.Limit, peer.Name)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user