Browse Source

Update weed/s3api/s3api_bucket_config.go

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
pull/7613/head
Chris Lu 1 day ago
committed by GitHub
parent
commit
f398660817
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 20
      weed/s3api/s3api_bucket_config.go

20
weed/s3api/s3api_bucket_config.go

@ -516,16 +516,16 @@ func (s3a *S3ApiServer) isVersioningConfigured(bucket string) (bool, error) {
// getVersioningState returns the detailed versioning state for a bucket // getVersioningState returns the detailed versioning state for a bucket
func (s3a *S3ApiServer) getVersioningState(bucket string) (string, error) { func (s3a *S3ApiServer) getVersioningState(bucket string) (string, error) {
config, errCode := s3a.getBucketConfig(bucket)
if errCode != s3err.ErrNone {
if errCode == s3err.ErrNoSuchBucket {
// Signal to callers that the bucket does not exist so they can
// decide whether to auto-create it (e.g., in PUT handlers).
return "", filer_pb.ErrNotFound
}
glog.Errorf("getVersioningState: failed to get bucket config for %s: %v", bucket, errCode)
return "", fmt.Errorf("failed to get bucket config: %v", errCode)
}
config, errCode := s3a.getBucketConfig(bucket)
if errCode != s3err.ErrNone {
if errCode == s3err.ErrNoSuchBucket {
// Signal to callers that the bucket does not exist so they can
// decide whether to auto-create it (e.g., in PUT handlers).
return "", filer_pb.ErrNotFound
}
glog.Errorf("getVersioningState: failed to get bucket config for %s: %v", bucket, errCode)
return "", fmt.Errorf("failed to get bucket config: %v", errCode)
}
// If object lock is enabled, versioning must be enabled regardless of explicit setting // If object lock is enabled, versioning must be enabled regardless of explicit setting
if config.ObjectLockConfig != nil { if config.ObjectLockConfig != nil {

Loading…
Cancel
Save