Fix bug preventing overwrite of object if (#8796)

object lock config is enabled for a bucket.

Creating a bucket with object lock configuration
enabled does not automatically cause WORM protection
to be applied. PUT operation needs to specifically
request object locking or bucket has to have default
retention settings configured.

Fixes regression introduced in #8657
This commit is contained in:
poornas
2020-01-13 17:29:31 -08:00
committed by Harshavardhana
parent 37b32199e3
commit 30922148fb
7 changed files with 10 additions and 14 deletions

View File

@@ -579,12 +579,9 @@ func iamPolicyClaimName() string {
return globalOpenIDConfig.ClaimPrefix + globalOpenIDConfig.ClaimName
}
func isWORMEnabled(bucket string) (Retention, bool) {
func isWORMEnabled(bucket string) bool {
if isMinioMetaBucketName(bucket) {
return Retention{}, false
return false
}
if globalWORMEnabled {
return Retention{}, true
}
return globalBucketObjectLockConfig.Get(bucket)
return globalWORMEnabled
}