aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Lu <chris.lu@gmail.com>2020-11-16 19:57:08 -0800
committerChris Lu <chris.lu@gmail.com>2020-11-16 19:57:08 -0800
commit9add554feb53706d1d878cc9636d234e622b8a80 (patch)
tree31449b78ac277c61c2452b37cc7c7cdc678a2491
parentc13db8de801da222032aed80e13da33b9c7bbaa9 (diff)
downloadseaweedfs-9add554feb53706d1d878cc9636d234e622b8a80.tar.xz
seaweedfs-9add554feb53706d1d878cc9636d234e622b8a80.zip
fail fast if user configures collection for a bucket
-rw-r--r--weed/shell/command_fs_configure.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/weed/shell/command_fs_configure.go b/weed/shell/command_fs_configure.go
index 86e8f1d18..bdef8b5e7 100644
--- a/weed/shell/command_fs_configure.go
+++ b/weed/shell/command_fs_configure.go
@@ -7,6 +7,7 @@ import (
"io"
"math"
"net/http"
+ "strings"
"github.com/chrislusf/seaweedfs/weed/filer"
"github.com/chrislusf/seaweedfs/weed/pb/filer_pb"
@@ -88,6 +89,9 @@ func (c *commandFsConfigure) Do(args []string, commandEnv *CommandEnv, writer io
Ttl: *ttl,
Fsync: *fsync,
}
+ if *collection != "" && strings.HasPrefix(*locationPrefix, "/buckets/") {
+ return fmt.Errorf("one s3 bucket goes to one collection and not customizable.")
+ }
if *isDelete {
fc.DeleteLocationConf(*locationPrefix)
} else {