simplify bucket metadata lookups for versioning/object locking (#17253)

This commit is contained in:
Harshavardhana
2023-05-22 12:05:14 -07:00
committed by GitHub
parent b1b00a5055
commit fc03be7891
5 changed files with 21 additions and 8 deletions
+3 -5
View File
@@ -1615,13 +1615,11 @@ func (c *SiteReplicationSys) syncToAllPeers(ctx context.Context) error {
return errSRBackendIssue(err)
}
var opts MakeBucketOptions
if meta.objectLockConfig != nil {
opts.LockEnabled = meta.objectLockConfig.ObjectLockEnabled == "Enabled"
opts := MakeBucketOptions{
LockEnabled: meta.ObjectLocking(),
CreatedAt: bucketInfo.Created.UTC(),
}
opts.CreatedAt = bucketInfo.Created.UTC()
// Now call the MakeBucketHook on existing bucket - this will
// create buckets and replication rules on peer clusters.
if err = c.MakeBucketHook(ctx, bucket, opts); err != nil {