Browse Source

go fmt

pull/7434/head
chrislu 1 month ago
parent
commit
d15ab56be7
  1. 1
      test/s3/retention/s3_bucket_delete_with_lock_test.go
  2. 6
      weed/command/download.go
  3. 10
      weed/s3api/s3api_object_handlers_acl.go
  4. 4
      weed/s3api/s3api_object_handlers_list.go
  5. 12
      weed/s3api/s3api_object_versioning.go

1
test/s3/retention/s3_bucket_delete_with_lock_test.go

@ -237,4 +237,3 @@ func TestBucketDeletionWithoutObjectLock(t *testing.T) {
require.NoError(t, err, "DeleteBucket should succeed for regular bucket") require.NoError(t, err, "DeleteBucket should succeed for regular bucket")
t.Logf("Successfully deleted regular bucket without object lock") t.Logf("Successfully deleted regular bucket without object lock")
} }

6
weed/command/download.go

@ -23,9 +23,9 @@ var (
) )
type DownloadOptions struct { type DownloadOptions struct {
master *string
server *string // deprecated, for backward compatibility
dir *string
master *string
server *string // deprecated, for backward compatibility
dir *string
} }
func init() { func init() {

10
weed/s3api/s3api_object_handlers_acl.go

@ -320,11 +320,11 @@ func (s3a *S3ApiServer) PutObjectAclHandler(w http.ResponseWriter, r *http.Reque
} }
if actualVersionId == "null" || actualVersionId == "" { if actualVersionId == "null" || actualVersionId == "" {
// Null version (pre-versioning object) - stored as regular file
updateDirectory = s3a.option.BucketsPath + "/" + bucket
} else {
// Versioned object - stored in .versions directory
updateDirectory = s3a.option.BucketsPath + "/" + bucket + "/" + object + s3_constants.VersionsFolder
// Null version (pre-versioning object) - stored as regular file
updateDirectory = s3a.option.BucketsPath + "/" + bucket
} else {
// Versioned object - stored in .versions directory
updateDirectory = s3a.option.BucketsPath + "/" + bucket + "/" + object + s3_constants.VersionsFolder
} }
} }
} else { } else {

4
weed/s3api/s3api_object_handlers_list.go

@ -510,8 +510,8 @@ func (s3a *S3ApiServer) doListFilerEntries(client filer_pb.SeaweedFilerClient, d
continue continue
} }
// Skip .versions directories in regular list operations but track them for logical object creation
if strings.HasSuffix(entry.Name, s3_constants.VersionsFolder) {
// Skip .versions directories in regular list operations but track them for logical object creation
if strings.HasSuffix(entry.Name, s3_constants.VersionsFolder) {
glog.V(4).Infof("Found .versions directory: %s", entry.Name) glog.V(4).Infof("Found .versions directory: %s", entry.Name)
versionsDirs = append(versionsDirs, entry.Name) versionsDirs = append(versionsDirs, entry.Name)
continue continue

12
weed/s3api/s3api_object_versioning.go

@ -300,10 +300,10 @@ func (s3a *S3ApiServer) findVersionsRecursively(currentPath, relativePath string
continue continue
} }
// Check if this is a .versions directory
if strings.HasSuffix(entry.Name, s3_constants.VersionsFolder) {
// Extract object name from .versions directory name
objectKey := strings.TrimSuffix(entryPath, s3_constants.VersionsFolder)
// Check if this is a .versions directory
if strings.HasSuffix(entry.Name, s3_constants.VersionsFolder) {
// Extract object name from .versions directory name
objectKey := strings.TrimSuffix(entryPath, s3_constants.VersionsFolder)
normalizedObjectKey := removeDuplicateSlashes(objectKey) normalizedObjectKey := removeDuplicateSlashes(objectKey)
// Mark both keys as processed for backward compatibility // Mark both keys as processed for backward compatibility
processedObjects[objectKey] = true processedObjects[objectKey] = true
@ -418,8 +418,8 @@ func (s3a *S3ApiServer) findVersionsRecursively(currentPath, relativePath string
} }
} }
// Check if a .versions directory exists for this object
versionsObjectPath := normalizedObjectKey + s3_constants.VersionsFolder
// Check if a .versions directory exists for this object
versionsObjectPath := normalizedObjectKey + s3_constants.VersionsFolder
_, versionsErr := s3a.getEntry(currentPath, versionsObjectPath) _, versionsErr := s3a.getEntry(currentPath, versionsObjectPath)
if versionsErr == nil { if versionsErr == nil {
// .versions directory exists // .versions directory exists

Loading…
Cancel
Save