mirror of
https://github.com/minio/minio.git
synced 2025-11-09 05:34:56 -05:00
Handle changes to versioning config for replication (#10598)
Disallow versioning suspension on a bucket with pre-existing replication configuration If versioning is suspended on the target,replication should fail.
This commit is contained in:
committed by
GitHub
parent
061fa0635c
commit
56d1b227cf
@@ -70,6 +70,14 @@ func (api objectAPIHandlers) PutBucketVersioningHandler(w http.ResponseWriter, r
|
||||
}, r.URL, guessIsBrowserReq(r))
|
||||
return
|
||||
}
|
||||
if _, err := getReplicationConfig(ctx, bucket); err == nil && v.Suspended() {
|
||||
writeErrorResponse(ctx, w, APIError{
|
||||
Code: "InvalidBucketState",
|
||||
Description: "A replication configuration is present on this bucket, so the versioning state cannot be changed.",
|
||||
HTTPStatusCode: http.StatusConflict,
|
||||
}, r.URL, guessIsBrowserReq(r))
|
||||
return
|
||||
}
|
||||
|
||||
configData, err := xml.Marshal(v)
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user