diff options
| author | Chris Lu <chris.lu@gmail.com> | 2021-09-05 11:55:52 -0700 |
|---|---|---|
| committer | Chris Lu <chris.lu@gmail.com> | 2021-09-05 11:55:52 -0700 |
| commit | 60573fd3e29d83a296dd58fed960cb3d13c20dda (patch) | |
| tree | 674da2a5e9a4df85fae17db4b971eb70b5e356f7 /weed/shell/command_remote_mount.go | |
| parent | 2348e8d8da2d452c31f6f7a6a9a5eb5a30e19345 (diff) | |
| download | seaweedfs-60573fd3e29d83a296dd58fed960cb3d13c20dda.tar.xz seaweedfs-60573fd3e29d83a296dd58fed960cb3d13c20dda.zip | |
option to map remote bucket to trimmed bucket name
Diffstat (limited to 'weed/shell/command_remote_mount.go')
| -rw-r--r-- | weed/shell/command_remote_mount.go | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/weed/shell/command_remote_mount.go b/weed/shell/command_remote_mount.go index 8e12ae3d5..c2d9ec6ba 100644 --- a/weed/shell/command_remote_mount.go +++ b/weed/shell/command_remote_mount.go @@ -124,7 +124,7 @@ func syncMetadata(commandEnv *CommandEnv, writer io.Writer, dir string, nonEmpty Name: name, }) if lookupErr != nil { - if !strings.Contains(lookupErr.Error(), filer_pb.ErrNotFound.Error()) { + if strings.Contains(lookupErr.Error(), filer_pb.ErrNotFound.Error()) { _, createErr := client.CreateEntry(context.Background(), &filer_pb.CreateEntryRequest{ Directory: parent, Entry: &filer_pb.Entry{ @@ -135,6 +135,9 @@ func syncMetadata(commandEnv *CommandEnv, writer io.Writer, dir string, nonEmpty Crtime: time.Now().Unix(), FileMode: uint32(0644 | os.ModeDir), }, + RemoteEntry: &filer_pb.RemoteEntry{ + StorageName: remoteConf.Name, + }, }, }) return createErr @@ -171,7 +174,6 @@ func syncMetadata(commandEnv *CommandEnv, writer io.Writer, dir string, nonEmpty return nil } - // if an entry has synchronized metadata but has not synchronized content // entry.Attributes.FileSize == entry.RemoteEntry.RemoteSize // entry.Attributes.Mtime == entry.RemoteEntry.RemoteMtime |
