Skip to content

Commit 2e300db

Browse files
support multisite replication setup (#1072)
1 parent 4cdb862 commit 2e300db

File tree

1 file changed

+10
-11
lines changed

1 file changed

+10
-11
lines changed

restapi/admin_remote_buckets.go

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@ func addRemoteBucket(ctx context.Context, client MinioAdmin, params models.Creat
269269
return bucketARN, err
270270
}
271271

272-
func addBucketReplicationItem(ctx context.Context, session *models.Principal, minClient minioClient, bucketName, prefix, arn, destinationBucket string, repDelMark, repDels, repMeta bool, tags string) error {
272+
func addBucketReplicationItem(ctx context.Context, session *models.Principal, minClient minioClient, bucketName, prefix, destinationARN string, repDelMark, repDels, repMeta bool, tags string) error {
273273
// we will tolerate this call failing
274274
cfg, err := minClient.getBucketReplication(ctx, bucketName)
275275
if err != nil {
@@ -310,15 +310,15 @@ func addBucketReplicationItem(ctx context.Context, session *models.Principal, mi
310310
}
311311

312312
opts := replication.Options{
313-
RoleArn: arn,
314-
Priority: fmt.Sprintf("%d", maxPrio),
315-
RuleStatus: "enable",
316-
DestBucket: destinationBucket,
317-
Op: replication.AddOption,
318-
TagString: tags,
319-
ReplicateDeleteMarkers: repDelMarkStatus,
320-
ReplicateDeletes: repDelsStatus,
321-
ReplicaSync: repMetaStatus,
313+
Priority: fmt.Sprintf("%d", maxPrio),
314+
RuleStatus: "enable",
315+
DestBucket: destinationARN,
316+
Op: replication.AddOption,
317+
TagString: tags,
318+
ExistingObjectReplicate: "enable", // enabled by default
319+
ReplicateDeleteMarkers: repDelMarkStatus,
320+
ReplicateDeletes: repDelsStatus,
321+
ReplicaSync: repMetaStatus,
322322
}
323323

324324
err2 := mcClient.setReplication(ctx, &cfg, opts)
@@ -363,7 +363,6 @@ func setMultiBucketReplication(ctx context.Context, session *models.Principal, c
363363
sourceBucket,
364364
params.Body.Prefix,
365365
arn,
366-
targetBucket,
367366
params.Body.ReplicateDeleteMarkers,
368367
params.Body.ReplicateDeletes,
369368
params.Body.ReplicateMetadata,

0 commit comments

Comments
 (0)