Browse Source

Remove deprecated allowEmptyFolder CLI option

The allowEmptyFolder option is no longer functional because:
1. The code that used it was already commented out
2. Empty folder cleanup is now handled asynchronously by EmptyFolderCleaner

The CLI flags are kept for backward compatibility but marked as deprecated
and ignored. This removes:
- S3ApiServerOption.AllowEmptyFolder field
- The actual usage in s3api_object_handlers_list.go
- Helm chart values and template references
- References in test Makefiles and docker-compose files
pull/7645/head
chrislu 3 days ago
parent
commit
5167bbd2a9
  1. 4
      Makefile
  2. 2
      docker/compose/local-s3tests-compose.yml
  3. 2
      docker/compose/test-tarantool-filer.yml
  4. 2
      docker/compose/test-ydb-filer.yml
  5. 5
      k8s/charts/seaweedfs/templates/all-in-one/all-in-one-deployment.yaml
  6. 3
      k8s/charts/seaweedfs/templates/filer/filer-statefulset.yaml
  7. 3
      k8s/charts/seaweedfs/templates/s3/s3-deployment.yaml
  8. 5
      k8s/charts/seaweedfs/values.yaml
  9. 2
      test/foundationdb/docker-compose.arm64.yml
  10. 2
      test/foundationdb/docker-compose.yml
  11. 1
      test/postgres/docker-compose.yml
  12. 3
      test/s3/cors/Makefile
  13. 3
      test/s3/retention/Makefile
  14. 3
      test/s3/tagging/Makefile
  15. 7
      test/s3/versioning/Makefile
  16. 2
      weed/command/filer.go
  17. 4
      weed/command/s3.go
  18. 2
      weed/command/server.go
  19. 10
      weed/s3api/s3api_object_handlers_list.go
  20. 1
      weed/s3api/s3api_server.go

4
Makefile

@ -18,12 +18,12 @@ full_install: admin-generate
cd weed; go install -tags "elastic gocdk sqlite ydb tarantool tikv rclone" cd weed; go install -tags "elastic gocdk sqlite ydb tarantool tikv rclone"
server: install server: install
weed -v 0 server -s3 -filer -filer.maxMB=64 -volume.max=0 -master.volumeSizeLimitMB=100 -volume.preStopSeconds=1 -s3.port=8000 -s3.allowEmptyFolder=false -s3.allowDeleteBucketNotEmpty=true -s3.config=./docker/compose/s3.json -metricsPort=9324
weed -v 0 server -s3 -filer -filer.maxMB=64 -volume.max=0 -master.volumeSizeLimitMB=100 -volume.preStopSeconds=1 -s3.port=8000 -s3.allowDeleteBucketNotEmpty=true -s3.config=./docker/compose/s3.json -metricsPort=9324
benchmark: install warp_install benchmark: install warp_install
pkill weed || true pkill weed || true
pkill warp || true pkill warp || true
weed server -debug=$(debug) -s3 -filer -volume.max=0 -master.volumeSizeLimitMB=100 -volume.preStopSeconds=1 -s3.port=8000 -s3.allowEmptyFolder=false -s3.allowDeleteBucketNotEmpty=false -s3.config=./docker/compose/s3.json &
weed server -debug=$(debug) -s3 -filer -volume.max=0 -master.volumeSizeLimitMB=100 -volume.preStopSeconds=1 -s3.port=8000 -s3.allowDeleteBucketNotEmpty=false -s3.config=./docker/compose/s3.json &
warp client & warp client &
while ! nc -z localhost 8000 ; do sleep 1 ; done while ! nc -z localhost 8000 ; do sleep 1 ; done
warp mixed --host=127.0.0.1:8000 --access-key=some_access_key1 --secret-key=some_secret_key1 --autoterm warp mixed --host=127.0.0.1:8000 --access-key=some_access_key1 --secret-key=some_secret_key1 --autoterm

2
docker/compose/local-s3tests-compose.yml

@ -24,7 +24,7 @@ services:
- 8888:8888 - 8888:8888
- 18888:18888 - 18888:18888
- 8000:8000 - 8000:8000
command: 'filer -master="master:9333" -s3 -s3.config=/etc/seaweedfs/s3.json -s3.port=8000 -s3.allowEmptyFolder=false -s3.allowDeleteBucketNotEmpty=false'
command: 'filer -master="master:9333" -s3 -s3.config=/etc/seaweedfs/s3.json -s3.port=8000 -s3.allowDeleteBucketNotEmpty=false'
volumes: volumes:
- ./s3.json:/etc/seaweedfs/s3.json - ./s3.json:/etc/seaweedfs/s3.json
depends_on: depends_on:

2
docker/compose/test-tarantool-filer.yml

@ -15,7 +15,7 @@ services:
s3: s3:
image: chrislusf/seaweedfs:local image: chrislusf/seaweedfs:local
command: "server -ip=127.0.0.1 -filer -master.volumeSizeLimitMB=16 -volume.max=0 -volume -volume.preStopSeconds=1 -s3 -s3.config=/etc/seaweedfs/s3.json -s3.port=8000 -s3.allowEmptyFolder=false -s3.allowDeleteBucketNotEmpty=false"
command: "server -ip=127.0.0.1 -filer -master.volumeSizeLimitMB=16 -volume.max=0 -volume -volume.preStopSeconds=1 -s3 -s3.config=/etc/seaweedfs/s3.json -s3.port=8000 -s3.allowDeleteBucketNotEmpty=false"
volumes: volumes:
- ./s3.json:/etc/seaweedfs/s3.json - ./s3.json:/etc/seaweedfs/s3.json
environment: environment:

2
docker/compose/test-ydb-filer.yml

@ -20,7 +20,7 @@ services:
- 8888:8888 - 8888:8888
- 8000:8000 - 8000:8000
- 18888:18888 - 18888:18888
command: "server -ip=s3 -filer -master.volumeSizeLimitMB=16 -volume.max=0 -volume -volume.preStopSeconds=1 -s3 -s3.config=/etc/seaweedfs/s3.json -s3.port=8000 -s3.allowEmptyFolder=false -s3.allowDeleteBucketNotEmpty=false"
command: "server -ip=s3 -filer -master.volumeSizeLimitMB=16 -volume.max=0 -volume -volume.preStopSeconds=1 -s3 -s3.config=/etc/seaweedfs/s3.json -s3.port=8000 -s3.allowDeleteBucketNotEmpty=false"
volumes: volumes:
- ./s3.json:/etc/seaweedfs/s3.json - ./s3.json:/etc/seaweedfs/s3.json
environment: environment:

5
k8s/charts/seaweedfs/templates/all-in-one/all-in-one-deployment.yaml

@ -246,11 +246,6 @@ spec:
-s3.cert.file=/usr/local/share/ca-certificates/client/tls.crt \ -s3.cert.file=/usr/local/share/ca-certificates/client/tls.crt \
-s3.key.file=/usr/local/share/ca-certificates/client/tls.key \ -s3.key.file=/usr/local/share/ca-certificates/client/tls.key \
{{- end }} {{- end }}
{{- if ne .Values.allInOne.s3.allowEmptyFolder nil }}
-s3.allowEmptyFolder={{ .Values.allInOne.s3.allowEmptyFolder }} \
{{- else if ne .Values.s3.allowEmptyFolder nil }}
-s3.allowEmptyFolder={{ .Values.s3.allowEmptyFolder }} \
{{- end }}
{{- if or .Values.allInOne.s3.enableAuth .Values.s3.enableAuth .Values.filer.s3.enableAuth }} {{- if or .Values.allInOne.s3.enableAuth .Values.s3.enableAuth .Values.filer.s3.enableAuth }}
-s3.config=/etc/sw/s3/seaweedfs_s3_config \ -s3.config=/etc/sw/s3/seaweedfs_s3_config \
{{- end }} {{- end }}

3
k8s/charts/seaweedfs/templates/filer/filer-statefulset.yaml

@ -213,9 +213,6 @@ spec:
-s3.cert.file=/usr/local/share/ca-certificates/client/tls.crt \ -s3.cert.file=/usr/local/share/ca-certificates/client/tls.crt \
-s3.key.file=/usr/local/share/ca-certificates/client/tls.key \ -s3.key.file=/usr/local/share/ca-certificates/client/tls.key \
{{- end }} {{- end }}
{{- if eq (typeOf .Values.filer.s3.allowEmptyFolder) "bool" }}
-s3.allowEmptyFolder={{ .Values.filer.s3.allowEmptyFolder }} \
{{- end }}
{{- if .Values.filer.s3.enableAuth }} {{- if .Values.filer.s3.enableAuth }}
-s3.config=/etc/sw/seaweedfs_s3_config \ -s3.config=/etc/sw/seaweedfs_s3_config \
{{- end }} {{- end }}

3
k8s/charts/seaweedfs/templates/s3/s3-deployment.yaml

@ -143,9 +143,6 @@ spec:
{{- if .Values.s3.domainName }} {{- if .Values.s3.domainName }}
-domainName={{ .Values.s3.domainName }} \ -domainName={{ .Values.s3.domainName }} \
{{- end }} {{- end }}
{{- if eq (typeOf .Values.s3.allowEmptyFolder) "bool" }}
-allowEmptyFolder={{ .Values.s3.allowEmptyFolder }} \
{{- end }}
{{- if .Values.s3.enableAuth }} {{- if .Values.s3.enableAuth }}
-config=/etc/sw/seaweedfs_s3_config \ -config=/etc/sw/seaweedfs_s3_config \
{{- end }} {{- end }}

5
k8s/charts/seaweedfs/values.yaml

@ -856,8 +856,6 @@ filer:
port: 8333 port: 8333
# add additional https port # add additional https port
httpsPort: 0 httpsPort: 0
# allow empty folders
allowEmptyFolder: false
# Suffix of the host name, {bucket}.{domainName} # Suffix of the host name, {bucket}.{domainName}
domainName: "" domainName: ""
# enable user & permission to s3 (need to inject to all services) # enable user & permission to s3 (need to inject to all services)
@ -885,8 +883,6 @@ s3:
httpsPort: 0 httpsPort: 0
metricsPort: 9327 metricsPort: 9327
loggingOverrideLevel: null loggingOverrideLevel: null
# allow empty folders
allowEmptyFolder: true
# enable user & permission to s3 (need to inject to all services) # enable user & permission to s3 (need to inject to all services)
enableAuth: false enableAuth: false
# set to the name of an existing kubernetes Secret with the s3 json config file # set to the name of an existing kubernetes Secret with the s3 json config file
@ -1133,7 +1129,6 @@ allInOne:
port: null # S3 gateway port (null inherits from s3.port) port: null # S3 gateway port (null inherits from s3.port)
httpsPort: null # S3 gateway HTTPS port (null inherits from s3.httpsPort) httpsPort: null # S3 gateway HTTPS port (null inherits from s3.httpsPort)
domainName: null # Suffix of the host name (null inherits from s3.domainName) domainName: null # Suffix of the host name (null inherits from s3.domainName)
allowEmptyFolder: null # Allow empty folders in S3 (null inherits from s3.allowEmptyFolder)
enableAuth: false # Enable user & permission to S3 enableAuth: false # Enable user & permission to S3
# Set to the name of an existing kubernetes Secret with the s3 json config file # Set to the name of an existing kubernetes Secret with the s3 json config file
# should have a secret key called seaweedfs_s3_config with an inline json config # should have a secret key called seaweedfs_s3_config with an inline json config

2
test/foundationdb/docker-compose.arm64.yml

@ -147,7 +147,7 @@ services:
- "8888:8888" - "8888:8888"
- "8333:8333" - "8333:8333"
- "18888:18888" - "18888:18888"
command: "server -ip=seaweedfs -filer -master.volumeSizeLimitMB=16 -volume.max=0 -volume -volume.preStopSeconds=1 -s3 -s3.config=/etc/seaweedfs/s3.json -s3.port=8333 -s3.allowEmptyFolder=false -s3.allowDeleteBucketNotEmpty=false"
command: "server -ip=seaweedfs -filer -master.volumeSizeLimitMB=16 -volume.max=0 -volume -volume.preStopSeconds=1 -s3 -s3.config=/etc/seaweedfs/s3.json -s3.port=8333 -s3.allowDeleteBucketNotEmpty=false"
volumes: volumes:
- ./s3.json:/etc/seaweedfs/s3.json - ./s3.json:/etc/seaweedfs/s3.json
- ./filer.toml:/etc/seaweedfs/filer.toml - ./filer.toml:/etc/seaweedfs/filer.toml

2
test/foundationdb/docker-compose.yml

@ -116,7 +116,7 @@ services:
- WEED_FOUNDATIONDB_MAX_RETRY_DELAY - WEED_FOUNDATIONDB_MAX_RETRY_DELAY
- WEED_MASTER_VOLUME_GROWTH_COPY_1=1 - WEED_MASTER_VOLUME_GROWTH_COPY_1=1
- WEED_MASTER_VOLUME_GROWTH_COPY_OTHER=1 - WEED_MASTER_VOLUME_GROWTH_COPY_OTHER=1
command: "weed server -ip=seaweedfs -filer -master.volumeSizeLimitMB=16 -volume.max=0 -volume -volume.preStopSeconds=1 -s3 -s3.config=/etc/seaweedfs/s3.json -s3.port=8333 -s3.allowEmptyFolder=false -s3.allowDeleteBucketNotEmpty=false"
command: "weed server -ip=seaweedfs -filer -master.volumeSizeLimitMB=16 -volume.max=0 -volume -volume.preStopSeconds=1 -s3 -s3.config=/etc/seaweedfs/s3.json -s3.port=8333 -s3.allowDeleteBucketNotEmpty=false"
configs: configs:
fdb.cluster: fdb.cluster:

1
test/postgres/docker-compose.yml

@ -30,7 +30,6 @@ services:
- -s3=true - -s3=true
- -s3.port=8333 - -s3.port=8333
- -webdav=false - -webdav=false
- -s3.allowEmptyFolder=false
- -mq.broker=true - -mq.broker=true
- -mq.agent=true - -mq.agent=true
- -ip=seaweedfs - -ip=seaweedfs

3
test/s3/cors/Makefile

@ -79,12 +79,11 @@ start-server: check-deps
@echo "🔍 DEBUG: Creating volume directory..." @echo "🔍 DEBUG: Creating volume directory..."
@mkdir -p ./test-volume-data @mkdir -p ./test-volume-data
@echo "🔍 DEBUG: Launching SeaweedFS server in background..." @echo "🔍 DEBUG: Launching SeaweedFS server in background..."
@echo "🔍 DEBUG: Command: $(WEED_BINARY) server -debug -s3 -s3.port=$(S3_PORT) -s3.allowEmptyFolder=false -s3.allowDeleteBucketNotEmpty=true -s3.config=../../../docker/compose/s3.json -filer -filer.maxMB=64 -master.volumeSizeLimitMB=50 -volume.max=100 -dir=./test-volume-data -volume.preStopSeconds=1 -metricsPort=9324"
@echo "🔍 DEBUG: Command: $(WEED_BINARY) server -debug -s3 -s3.port=$(S3_PORT) -s3.allowDeleteBucketNotEmpty=true -s3.config=../../../docker/compose/s3.json -filer -filer.maxMB=64 -master.volumeSizeLimitMB=50 -volume.max=100 -dir=./test-volume-data -volume.preStopSeconds=1 -metricsPort=9324"
@$(WEED_BINARY) server \ @$(WEED_BINARY) server \
-debug \ -debug \
-s3 \ -s3 \
-s3.port=$(S3_PORT) \ -s3.port=$(S3_PORT) \
-s3.allowEmptyFolder=false \
-s3.allowDeleteBucketNotEmpty=true \ -s3.allowDeleteBucketNotEmpty=true \
-s3.config=../../../docker/compose/s3.json \ -s3.config=../../../docker/compose/s3.json \
-filer \ -filer \

3
test/s3/retention/Makefile

@ -81,12 +81,11 @@ start-server: check-deps
@echo "🔍 DEBUG: Creating volume directory..." @echo "🔍 DEBUG: Creating volume directory..."
@mkdir -p ./test-volume-data @mkdir -p ./test-volume-data
@echo "🔍 DEBUG: Launching SeaweedFS server in background..." @echo "🔍 DEBUG: Launching SeaweedFS server in background..."
@echo "🔍 DEBUG: Command: $(WEED_BINARY) server -debug -s3 -s3.port=$(S3_PORT) -s3.allowEmptyFolder=false -s3.allowDeleteBucketNotEmpty=true -s3.config=../../../docker/compose/s3.json -filer -filer.maxMB=64 -master.volumeSizeLimitMB=50 -volume.max=100 -dir=./test-volume-data -volume.preStopSeconds=1 -metricsPort=9324"
@echo "🔍 DEBUG: Command: $(WEED_BINARY) server -debug -s3 -s3.port=$(S3_PORT) -s3.allowDeleteBucketNotEmpty=true -s3.config=../../../docker/compose/s3.json -filer -filer.maxMB=64 -master.volumeSizeLimitMB=50 -volume.max=100 -dir=./test-volume-data -volume.preStopSeconds=1 -metricsPort=9324"
@$(WEED_BINARY) server \ @$(WEED_BINARY) server \
-debug \ -debug \
-s3 \ -s3 \
-s3.port=$(S3_PORT) \ -s3.port=$(S3_PORT) \
-s3.allowEmptyFolder=false \
-s3.allowDeleteBucketNotEmpty=true \ -s3.allowDeleteBucketNotEmpty=true \
-s3.config=../../../docker/compose/s3.json \ -s3.config=../../../docker/compose/s3.json \
-filer \ -filer \

3
test/s3/tagging/Makefile

@ -77,7 +77,7 @@ start-server: check-deps
@echo "🔍 DEBUG: Creating volume directory..." @echo "🔍 DEBUG: Creating volume directory..."
@mkdir -p ./test-volume-data @mkdir -p ./test-volume-data
@echo "🔍 DEBUG: Launching SeaweedFS server in background..." @echo "🔍 DEBUG: Launching SeaweedFS server in background..."
@echo "🔍 DEBUG: Command: $(WEED_BINARY) server -filer -filer.maxMB=64 -s3 -ip.bind 0.0.0.0 -dir=./test-volume-data -master.raftHashicorp -master.electionTimeout 1s -master.volumeSizeLimitMB=100 -volume.max=100 -volume.preStopSeconds=1 -master.port=$(MASTER_PORT) -volume.port=$(VOLUME_PORT) -filer.port=$(FILER_PORT) -s3.port=$(S3_PORT) -metricsPort=9329 -s3.allowEmptyFolder=false -s3.allowDeleteBucketNotEmpty=true -s3.config=../../../docker/compose/s3.json -master.peers=none"
@echo "🔍 DEBUG: Command: $(WEED_BINARY) server -filer -filer.maxMB=64 -s3 -ip.bind 0.0.0.0 -dir=./test-volume-data -master.raftHashicorp -master.electionTimeout 1s -master.volumeSizeLimitMB=100 -volume.max=100 -volume.preStopSeconds=1 -master.port=$(MASTER_PORT) -volume.port=$(VOLUME_PORT) -filer.port=$(FILER_PORT) -s3.port=$(S3_PORT) -metricsPort=9329 -s3.allowDeleteBucketNotEmpty=true -s3.config=../../../docker/compose/s3.json -master.peers=none"
@$(WEED_BINARY) server \ @$(WEED_BINARY) server \
-filer \ -filer \
-filer.maxMB=64 \ -filer.maxMB=64 \
@ -94,7 +94,6 @@ start-server: check-deps
-filer.port=$(FILER_PORT) \ -filer.port=$(FILER_PORT) \
-s3.port=$(S3_PORT) \ -s3.port=$(S3_PORT) \
-metricsPort=9329 \ -metricsPort=9329 \
-s3.allowEmptyFolder=false \
-s3.allowDeleteBucketNotEmpty=true \ -s3.allowDeleteBucketNotEmpty=true \
-s3.config=../../../docker/compose/s3.json \ -s3.config=../../../docker/compose/s3.json \
-master.peers=none \ -master.peers=none \

7
test/s3/versioning/Makefile

@ -81,12 +81,11 @@ start-server: check-deps
@echo "🔍 DEBUG: Creating volume directory..." @echo "🔍 DEBUG: Creating volume directory..."
@mkdir -p ./test-volume-data @mkdir -p ./test-volume-data
@echo "🔍 DEBUG: Launching SeaweedFS server in background..." @echo "🔍 DEBUG: Launching SeaweedFS server in background..."
@echo "🔍 DEBUG: Command: $(WEED_BINARY) server -debug -s3 -s3.port=$(S3_PORT) -s3.allowEmptyFolder=false -s3.allowDeleteBucketNotEmpty=true -s3.config=../../../docker/compose/s3.json -filer -filer.maxMB=64 -master.volumeSizeLimitMB=50 -volume.max=100 -dir=./test-volume-data -volume.preStopSeconds=1 -metricsPort=9324"
@echo "🔍 DEBUG: Command: $(WEED_BINARY) server -debug -s3 -s3.port=$(S3_PORT) -s3.allowDeleteBucketNotEmpty=true -s3.config=../../../docker/compose/s3.json -filer -filer.maxMB=64 -master.volumeSizeLimitMB=50 -volume.max=100 -dir=./test-volume-data -volume.preStopSeconds=1 -metricsPort=9324"
@$(WEED_BINARY) server \ @$(WEED_BINARY) server \
-debug \ -debug \
-s3 \ -s3 \
-s3.port=$(S3_PORT) \ -s3.port=$(S3_PORT) \
-s3.allowEmptyFolder=false \
-s3.allowDeleteBucketNotEmpty=true \ -s3.allowDeleteBucketNotEmpty=true \
-s3.config=../../../docker/compose/s3.json \ -s3.config=../../../docker/compose/s3.json \
-filer \ -filer \
@ -222,7 +221,7 @@ test-with-server: start-server
test-versioning-with-configs: check-deps test-versioning-with-configs: check-deps
@echo "Testing with different S3 configurations..." @echo "Testing with different S3 configurations..."
@echo "Testing with empty folder allowed..." @echo "Testing with empty folder allowed..."
@$(WEED_BINARY) server -s3 -s3.port=$(S3_PORT) -s3.allowEmptyFolder=true -filer -master.volumeSizeLimitMB=100 -volume.max=100 > weed-test-config1.log 2>&1 & echo $$! > weed-config1.pid
@$(WEED_BINARY) server -s3 -s3.port=$(S3_PORT) -filer -master.volumeSizeLimitMB=100 -volume.max=100 > weed-test-config1.log 2>&1 & echo $$! > weed-config1.pid
@sleep 5 @sleep 5
@go test -v -timeout=5m -run "TestVersioningBasicWorkflow" . || true @go test -v -timeout=5m -run "TestVersioningBasicWorkflow" . || true
@if [ -f weed-config1.pid ]; then kill -TERM $$(cat weed-config1.pid) 2>/dev/null || true; rm -f weed-config1.pid; fi @if [ -f weed-config1.pid ]; then kill -TERM $$(cat weed-config1.pid) 2>/dev/null || true; rm -f weed-config1.pid; fi
@ -268,7 +267,6 @@ debug-server:
-debug \ -debug \
-s3 \ -s3 \
-s3.port=$(S3_PORT) \ -s3.port=$(S3_PORT) \
-s3.allowEmptyFolder=false \
-s3.allowDeleteBucketNotEmpty=true \ -s3.allowDeleteBucketNotEmpty=true \
-s3.config=../../../docker/compose/s3.json \ -s3.config=../../../docker/compose/s3.json \
-filer \ -filer \
@ -317,7 +315,6 @@ start-server-simple: check-deps
-debug \ -debug \
-s3 \ -s3 \
-s3.port=$(S3_PORT) \ -s3.port=$(S3_PORT) \
-s3.allowEmptyFolder=false \
-s3.allowDeleteBucketNotEmpty=true \ -s3.allowDeleteBucketNotEmpty=true \
-s3.config=../../../docker/compose/s3.json \ -s3.config=../../../docker/compose/s3.json \
-filer \ -filer \

2
weed/command/filer.go

@ -122,7 +122,7 @@ func init() {
filerS3Options.tlsCertificate = cmdFiler.Flag.String("s3.cert.file", "", "path to the TLS certificate file") filerS3Options.tlsCertificate = cmdFiler.Flag.String("s3.cert.file", "", "path to the TLS certificate file")
filerS3Options.config = cmdFiler.Flag.String("s3.config", "", "path to the config file") filerS3Options.config = cmdFiler.Flag.String("s3.config", "", "path to the config file")
filerS3Options.auditLogConfig = cmdFiler.Flag.String("s3.auditLogConfig", "", "path to the audit log config file") filerS3Options.auditLogConfig = cmdFiler.Flag.String("s3.auditLogConfig", "", "path to the audit log config file")
filerS3Options.allowEmptyFolder = cmdFiler.Flag.Bool("s3.allowEmptyFolder", true, "allow empty folders")
cmdFiler.Flag.Bool("s3.allowEmptyFolder", true, "deprecated, ignored. Empty folder cleanup is now automatic.")
filerS3Options.allowDeleteBucketNotEmpty = cmdFiler.Flag.Bool("s3.allowDeleteBucketNotEmpty", true, "allow recursive deleting all entries along with bucket") filerS3Options.allowDeleteBucketNotEmpty = cmdFiler.Flag.Bool("s3.allowDeleteBucketNotEmpty", true, "allow recursive deleting all entries along with bucket")
filerS3Options.localSocket = cmdFiler.Flag.String("s3.localSocket", "", "default to /tmp/seaweedfs-s3-<port>.sock") filerS3Options.localSocket = cmdFiler.Flag.String("s3.localSocket", "", "default to /tmp/seaweedfs-s3-<port>.sock")
filerS3Options.tlsCACertificate = cmdFiler.Flag.String("s3.cacert.file", "", "path to the TLS CA certificate file") filerS3Options.tlsCACertificate = cmdFiler.Flag.String("s3.cacert.file", "", "path to the TLS CA certificate file")

4
weed/command/s3.go

@ -49,7 +49,6 @@ type S3Options struct {
tlsVerifyClientCert *bool tlsVerifyClientCert *bool
metricsHttpPort *int metricsHttpPort *int
metricsHttpIp *string metricsHttpIp *string
allowEmptyFolder *bool
allowDeleteBucketNotEmpty *bool allowDeleteBucketNotEmpty *bool
auditLogConfig *string auditLogConfig *string
localFilerSocket *string localFilerSocket *string
@ -80,7 +79,7 @@ func init() {
s3StandaloneOptions.tlsVerifyClientCert = cmdS3.Flag.Bool("tlsVerifyClientCert", false, "whether to verify the client's certificate") s3StandaloneOptions.tlsVerifyClientCert = cmdS3.Flag.Bool("tlsVerifyClientCert", false, "whether to verify the client's certificate")
s3StandaloneOptions.metricsHttpPort = cmdS3.Flag.Int("metricsPort", 0, "Prometheus metrics listen port") s3StandaloneOptions.metricsHttpPort = cmdS3.Flag.Int("metricsPort", 0, "Prometheus metrics listen port")
s3StandaloneOptions.metricsHttpIp = cmdS3.Flag.String("metricsIp", "", "metrics listen ip. If empty, default to same as -ip.bind option.") s3StandaloneOptions.metricsHttpIp = cmdS3.Flag.String("metricsIp", "", "metrics listen ip. If empty, default to same as -ip.bind option.")
s3StandaloneOptions.allowEmptyFolder = cmdS3.Flag.Bool("allowEmptyFolder", true, "allow empty folders")
cmdS3.Flag.Bool("allowEmptyFolder", true, "deprecated, ignored. Empty folder cleanup is now automatic.")
s3StandaloneOptions.allowDeleteBucketNotEmpty = cmdS3.Flag.Bool("allowDeleteBucketNotEmpty", true, "allow recursive deleting all entries along with bucket") s3StandaloneOptions.allowDeleteBucketNotEmpty = cmdS3.Flag.Bool("allowDeleteBucketNotEmpty", true, "allow recursive deleting all entries along with bucket")
s3StandaloneOptions.localFilerSocket = cmdS3.Flag.String("localFilerSocket", "", "local filer socket path") s3StandaloneOptions.localFilerSocket = cmdS3.Flag.String("localFilerSocket", "", "local filer socket path")
s3StandaloneOptions.localSocket = cmdS3.Flag.String("localSocket", "", "default to /tmp/seaweedfs-s3-<port>.sock") s3StandaloneOptions.localSocket = cmdS3.Flag.String("localSocket", "", "default to /tmp/seaweedfs-s3-<port>.sock")
@ -273,7 +272,6 @@ func (s3opt *S3Options) startS3Server() bool {
AllowedOrigins: strings.Split(*s3opt.allowedOrigins, ","), AllowedOrigins: strings.Split(*s3opt.allowedOrigins, ","),
BucketsPath: filerBucketsPath, BucketsPath: filerBucketsPath,
GrpcDialOption: grpcDialOption, GrpcDialOption: grpcDialOption,
AllowEmptyFolder: *s3opt.allowEmptyFolder,
AllowDeleteBucketNotEmpty: *s3opt.allowDeleteBucketNotEmpty, AllowDeleteBucketNotEmpty: *s3opt.allowDeleteBucketNotEmpty,
LocalFilerSocket: localFilerSocket, LocalFilerSocket: localFilerSocket,
DataCenter: *s3opt.dataCenter, DataCenter: *s3opt.dataCenter,

2
weed/command/server.go

@ -166,7 +166,7 @@ func init() {
s3Options.config = cmdServer.Flag.String("s3.config", "", "path to the config file") s3Options.config = cmdServer.Flag.String("s3.config", "", "path to the config file")
s3Options.iamConfig = cmdServer.Flag.String("s3.iam.config", "", "path to the advanced IAM config file for S3. Overrides -iam.config if both are provided.") s3Options.iamConfig = cmdServer.Flag.String("s3.iam.config", "", "path to the advanced IAM config file for S3. Overrides -iam.config if both are provided.")
s3Options.auditLogConfig = cmdServer.Flag.String("s3.auditLogConfig", "", "path to the audit log config file") s3Options.auditLogConfig = cmdServer.Flag.String("s3.auditLogConfig", "", "path to the audit log config file")
s3Options.allowEmptyFolder = cmdServer.Flag.Bool("s3.allowEmptyFolder", true, "allow empty folders")
cmdServer.Flag.Bool("s3.allowEmptyFolder", true, "deprecated, ignored. Empty folder cleanup is now automatic.")
s3Options.allowDeleteBucketNotEmpty = cmdServer.Flag.Bool("s3.allowDeleteBucketNotEmpty", true, "allow recursive deleting all entries along with bucket") s3Options.allowDeleteBucketNotEmpty = cmdServer.Flag.Bool("s3.allowDeleteBucketNotEmpty", true, "allow recursive deleting all entries along with bucket")
s3Options.localSocket = cmdServer.Flag.String("s3.localSocket", "", "default to /tmp/seaweedfs-s3-<port>.sock") s3Options.localSocket = cmdServer.Flag.String("s3.localSocket", "", "default to /tmp/seaweedfs-s3-<port>.sock")
s3Options.bindIp = cmdServer.Flag.String("s3.ip.bind", "", "ip address to bind to. If empty, default to same as -ip.bind option.") s3Options.bindIp = cmdServer.Flag.String("s3.ip.bind", "", "ip address to bind to. If empty, default to same as -ip.bind option.")

10
weed/s3api/s3api_object_handlers_list.go

@ -554,15 +554,7 @@ func (s3a *S3ApiServer) doListFilerEntries(client filer_pb.SeaweedFilerClient, d
} }
// println("doListFilerEntries2 nextMarker", nextMarker) // println("doListFilerEntries2 nextMarker", nextMarker)
} else { } else {
var isEmpty bool
if !s3a.option.AllowEmptyFolder && entry.IsOlderDir() {
//if isEmpty, err = s3a.ensureDirectoryAllEmpty(client, dir, entry.Name); err != nil {
// glog.Errorf("check empty folder %s: %v", dir, err)
//}
}
if !isEmpty {
eachEntryFn(dir, entry)
}
eachEntryFn(dir, entry)
} }
} else { } else {
eachEntryFn(dir, entry) eachEntryFn(dir, entry)

1
weed/s3api/s3api_server.go

@ -43,7 +43,6 @@ type S3ApiServerOption struct {
AllowedOrigins []string AllowedOrigins []string
BucketsPath string BucketsPath string
GrpcDialOption grpc.DialOption GrpcDialOption grpc.DialOption
AllowEmptyFolder bool
AllowDeleteBucketNotEmpty bool AllowDeleteBucketNotEmpty bool
LocalFilerSocket string LocalFilerSocket string
DataCenter string DataCenter string

Loading…
Cancel
Save