Browse Source

Merge branch '3.37_acl' into _product

# Conflicts:
#	weed/shell/command_fs_configure.go
pull/5936/head
changlin.shi 1 year ago
parent
commit
c3e1d245db
  1. 7
      weed/filer/filer_conf.go
  2. 10
      weed/shell/command_fs_configure.go

7
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
}

10
weed/shell/command_fs_configure.go

@ -4,10 +4,11 @@ import (
"bytes"
"flag"
"fmt"
"io"
"github.com/seaweedfs/seaweedfs/weed/filer"
"github.com/seaweedfs/seaweedfs/weed/pb/filer_pb"
"github.com/seaweedfs/seaweedfs/weed/storage/super_block"
"io"
)
func init() {
@ -49,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|<tag>] 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")
@ -84,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)

Loading…
Cancel
Save