From 03b84091fc2d5a5cdef1544d90294ba2ca4de344 Mon Sep 17 00:00:00 2001 From: Harshavardhana Date: Fri, 3 Jul 2020 15:30:06 -0700 Subject: [PATCH] auto enable versioning with object locking (#9967) this is to preserve versioning for object-locked buckets from current release code. --- cmd/bucket-metadata.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cmd/bucket-metadata.go b/cmd/bucket-metadata.go index 5956b357c..30f735c85 100644 --- a/cmd/bucket-metadata.go +++ b/cmd/bucket-metadata.go @@ -186,6 +186,10 @@ func (b *BucketMetadata) parseAllConfigs(ctx context.Context, objectAPI ObjectLa b.taggingConfig = nil } + if bytes.Equal(b.ObjectLockConfigXML, enabledBucketObjectLockConfig) { + b.VersioningConfigXML = enabledBucketVersioningConfig + } + if len(b.ObjectLockConfigXML) != 0 { b.objectLockConfig, err = objectlock.ParseObjectLockConfig(bytes.NewReader(b.ObjectLockConfigXML)) if err != nil {