diff --git a/pkg/replication/replication.go b/pkg/replication/replication.go index 0abbf6efc..65a2f75e9 100644 --- a/pkg/replication/replication.go +++ b/pkg/replication/replication.go @@ -406,6 +406,9 @@ func (c *Config) EditRule(opts Options) error { return fmt.Errorf("priority must be unique. Replication configuration already has a rule with this priority") } if rule.Destination.Bucket != newRule.Destination.Bucket && rule.ID == newRule.ID { + if c.Role == newRule.Destination.Bucket { + continue + } return fmt.Errorf("invalid destination bucket for this rule") } } diff --git a/pkg/replication/replication_test.go b/pkg/replication/replication_test.go index 1e29f7940..cb85259b2 100644 --- a/pkg/replication/replication_test.go +++ b/pkg/replication/replication_test.go @@ -180,7 +180,7 @@ func TestEditReplicationRule(t *testing.T) { StorageClass: "STANDARD", DestBucket: "arn:minio:replication:eu-west-1:c5acb6ac-9918-4dc6-8534-6244ed1a611a:destbucket", }, - expectedErr: "invalid destination bucket for this rule", + expectedErr: "", }, { // test case :2 mismatched rule id cfg: Config{