option to map remote bucket to trimmed bucket name

This commit is contained in:
Chris Lu
2021-09-05 11:55:52 -07:00
parent 2348e8d8da
commit 60573fd3e2
3 changed files with 20 additions and 3 deletions

View File

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