@@ -260,14 +260,8 @@ func getBucketReplicationResponse(session *models.Principal, params bucketApi.Ge
260
260
var rules []* models.BucketReplicationRule
261
261
262
262
for _ , rule := range res .Rules {
263
- repDelMarkerStatus := false
264
- if rule .DeleteMarkerReplication .Status == "enable" {
265
- repDelMarkerStatus = true
266
- }
267
- repDelStatus := false
268
- if rule .DeleteReplication .Status == "enable" {
269
- repDelMarkerStatus = true
270
- }
263
+ repDelMarkerStatus := rule .DeleteMarkerReplication .Status == replication .Enabled
264
+ repDelStatus := rule .DeleteReplication .Status == replication .Enabled
271
265
272
266
rules = append (rules , & models.BucketReplicationRule {
273
267
DeleteMarkerReplication : repDelMarkerStatus ,
@@ -322,22 +316,10 @@ func getBucketReplicationRuleResponse(session *models.Principal, params bucketAp
322
316
return nil , ErrorWithContext (ctx , errors .New ("no rule is set with this ID" ))
323
317
}
324
318
325
- repDelMarkerStatus := false
326
- if foundRule .DeleteMarkerReplication .Status == "Enabled" {
327
- repDelMarkerStatus = true
328
- }
329
- repDelStatus := false
330
- if foundRule .DeleteReplication .Status == "Enabled" {
331
- repDelStatus = true
332
- }
333
- existingObjects := false
334
- if foundRule .ExistingObjectReplication .Status == "Enabled" {
335
- existingObjects = true
336
- }
337
- metadataModifications := false
338
- if foundRule .SourceSelectionCriteria .ReplicaModifications .Status == "Enabled" {
339
- metadataModifications = true
340
- }
319
+ repDelMarkerStatus := foundRule .DeleteMarkerReplication .Status == replication .Enabled
320
+ repDelStatus := foundRule .DeleteReplication .Status == replication .Enabled
321
+ existingObjects := foundRule .ExistingObjectReplication .Status == replication .Enabled
322
+ metadataModifications := foundRule .SourceSelectionCriteria .ReplicaModifications .Status == replication .Enabled
341
323
342
324
returnRule := & models.BucketReplicationRule {
343
325
DeleteMarkerReplication : repDelMarkerStatus ,
@@ -729,6 +711,7 @@ func getBucketInfo(ctx context.Context, client MinioClient, adminClient MinioAdm
729
711
for _ , bucket := range info .Buckets {
730
712
if bucket .Name == bucketName {
731
713
bucketInfo = bucket
714
+ break
732
715
}
733
716
}
734
717
0 commit comments