diff --git a/weed/filer/filer_conf.go b/weed/filer/filer_conf.go index ccb1acb3c..a4ab7f249 100644 --- a/weed/filer/filer_conf.go +++ b/weed/filer/filer_conf.go @@ -92,8 +92,11 @@ func (fc *FilerConf) loadFromChunks(filer *Filer, content []byte, chunks []*file func (fc *FilerConf) LoadFromBytes(data []byte) (err error) { conf := &filer_pb.FilerConf{} - - if err := jsonpb.Unmarshal(data, conf); err != nil { + options := &jsonpb.UnmarshalOptions{ + DiscardUnknown: true, + AllowPartial: true, + } + if err := options.Unmarshal(data, conf); err != nil { return err } diff --git a/weed/shell/command_fs_configure.go b/weed/shell/command_fs_configure.go index 60edb79c2..901d7971e 100644 --- a/weed/shell/command_fs_configure.go +++ b/weed/shell/command_fs_configure.go @@ -5,7 +5,6 @@ import ( "flag" "fmt" "io" - "strings" "github.com/seaweedfs/seaweedfs/weed/filer" "github.com/seaweedfs/seaweedfs/weed/pb/filer_pb" @@ -51,7 +50,7 @@ func (c *commandFsConfigure) Do(args []string, commandEnv *CommandEnv, writer io locationPrefix := fsConfigureCommand.String("locationPrefix", "", "path prefix, required to update the path-specific configuration") collection := fsConfigureCommand.String("collection", "", "assign writes to this collection") replication := fsConfigureCommand.String("replication", "", "assign writes with this replication") - ttl := fsConfigureCommand.String("ttl", "", "assign writes with this ttl") + ttl := fsConfigureCommand.String("ttl", "", "assign writes with this ttl (e.g., 1m, 1h, 1d, 1w, 1y)") diskType := fsConfigureCommand.String("disk", "", "[hdd|ssd|] hard drive or solid state drive or any tag") fsync := fsConfigureCommand.Bool("fsync", false, "fsync for the writes") isReadOnly := fsConfigureCommand.Bool("readOnly", false, "disable writes") @@ -86,11 +85,6 @@ func (c *commandFsConfigure) Do(args []string, commandEnv *CommandEnv, writer io DataNode: *dataNode, } - // check collection - if *collection != "" && strings.HasPrefix(*locationPrefix, "/buckets/") { - return fmt.Errorf("one s3 bucket goes to one collection and not customizable") - } - // check replication if *replication != "" { rp, err := super_block.NewReplicaPlacementFromString(*replication)