diff options
| author | chrislu <chris.lu@gmail.com> | 2025-07-18 00:19:47 -0700 |
|---|---|---|
| committer | chrislu <chris.lu@gmail.com> | 2025-07-18 00:19:47 -0700 |
| commit | 7bec2ef94b303f36912f58816ca6295ed2d69cfe (patch) | |
| tree | 625d87a340468f3a090117bd6a978a53018dc4c2 /weed/s3api/s3api_bucket_handlers.go | |
| parent | f9cbed7ee1a59c1345466b80e254a656352cc143 (diff) | |
| download | seaweedfs-7bec2ef94b303f36912f58816ca6295ed2d69cfe.tar.xz seaweedfs-7bec2ef94b303f36912f58816ca6295ed2d69cfe.zip | |
cache and use bucket object lock config
Diffstat (limited to 'weed/s3api/s3api_bucket_handlers.go')
| -rw-r--r-- | weed/s3api/s3api_bucket_handlers.go | 16 |
1 files changed, 2 insertions, 14 deletions
diff --git a/weed/s3api/s3api_bucket_handlers.go b/weed/s3api/s3api_bucket_handlers.go index 0bc4a7b10..e30f172a7 100644 --- a/weed/s3api/s3api_bucket_handlers.go +++ b/weed/s3api/s3api_bucket_handlers.go @@ -147,25 +147,13 @@ func (s3a *S3ApiServer) PutBucketHandler(w http.ResponseWriter, r *http.Request) // Enable versioning (required for Object Lock) bucketConfig.Versioning = s3_constants.VersioningEnabled - // Enable Object Lock configuration - if bucketConfig.Entry.Extended == nil { - bucketConfig.Entry.Extended = make(map[string][]byte) - } - // Create basic Object Lock configuration (enabled without default retention) - // The ObjectLockConfiguration struct is defined below in this file. objectLockConfig := &ObjectLockConfiguration{ ObjectLockEnabled: s3_constants.ObjectLockEnabled, } - // Store the configuration as XML in extended attributes - configXML, err := xml.Marshal(objectLockConfig) - if err != nil { - return fmt.Errorf("failed to marshal Object Lock configuration to XML: %w", err) - } - - bucketConfig.Entry.Extended[s3_constants.ExtObjectLockConfigKey] = configXML - bucketConfig.Entry.Extended[s3_constants.ExtObjectLockEnabledKey] = []byte(s3_constants.ObjectLockEnabled) + // Set the cached Object Lock configuration + bucketConfig.ObjectLockConfig = objectLockConfig return nil }) |
