Skip to content

Commit e0ba2df

Browse files
authored
fix replication validation for Role ARN (#1978)
1 parent b28095b commit e0ba2df

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

pkg/replication/replication.go

+3
Original file line numberDiff line numberDiff line change
@@ -406,6 +406,9 @@ func (c *Config) EditRule(opts Options) error {
406406
return fmt.Errorf("priority must be unique. Replication configuration already has a rule with this priority")
407407
}
408408
if rule.Destination.Bucket != newRule.Destination.Bucket && rule.ID == newRule.ID {
409+
if c.Role == newRule.Destination.Bucket {
410+
continue
411+
}
409412
return fmt.Errorf("invalid destination bucket for this rule")
410413
}
411414
}

pkg/replication/replication_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ func TestEditReplicationRule(t *testing.T) {
180180
StorageClass: "STANDARD",
181181
DestBucket: "arn:minio:replication:eu-west-1:c5acb6ac-9918-4dc6-8534-6244ed1a611a:destbucket",
182182
},
183-
expectedErr: "invalid destination bucket for this rule",
183+
expectedErr: "",
184184
},
185185
{ // test case :2 mismatched rule id
186186
cfg: Config{

0 commit comments

Comments
 (0)