SeaweedFS is a distributed storage system for object storage (S3), file systems, Iceberg table buckets, and Lance vector buckets, designed to handle billions of files with O(1) disk access and effortless horizontal scaling.
Go blob-storagecloud-drivedistributed-file-systemdistributed-storageerasure-codingfusehadoop-hdfshdfskuberneteslancelancedbobject-storageposixs3s3-storageseaweedfstiered-file-systemvector-search
fix tests
Chris Luf6a9ad8001c4
diff --git a/weed/filer/filer_remote_storage.go b/weed/filer/filer_remote_storage.goindex 0967de1a64..a859ad34b0 100644--- a/weed/filer/filer_remote_storage.go+++ b/weed/filer/filer_remote_storage.go@@ -87,19 +87,18 @@ func (rs *FilerRemoteStorage) FindMountDirectory(p util.FullPath) (mountDir util}func (rs *FilerRemoteStorage) FindRemoteStorageClient(p util.FullPath) (client remote_storage.RemoteStorageClient, remoteConf *filer_pb.RemoteConf, found bool) {- var storageLocation string+ var storageLocation *filer_pb.RemoteStorageLocationrs.rules.MatchPrefix([]byte(p), func(key []byte, value interface{}) bool {- storageLocation = value.(string)+ storageLocation = value.(*filer_pb.RemoteStorageLocation)return true})- if storageLocation == "" {+ if storageLocation == nil {+ found = falsereturn}- loc := remote_storage.ParseLocation(storageLocation)-- return rs.GetRemoteStorageClient(loc.Name)+ return rs.GetRemoteStorageClient(storageLocation.Name)}func (rs *FilerRemoteStorage) GetRemoteStorageClient(storageName string) (client remote_storage.RemoteStorageClient, remoteConf *filer_pb.RemoteConf, found bool) {diff --git a/weed/filer/filer_remote_storage_test.go b/weed/filer/filer_remote_storage_test.goindex e5996475e9..427cd5a8a2 100644--- a/weed/filer/filer_remote_storage_test.go+++ b/weed/filer/filer_remote_storage_test.go@@ -14,7 +14,11 @@ func TestFilerRemoteStorage_FindRemoteStorageClient(t *testing.T) {rs := NewFilerRemoteStorage()rs.storageNameToConf[conf.Name] = conf- rs.mapDirectoryToRemoteStorage("/a/b/c", "s7")+ rs.mapDirectoryToRemoteStorage("/a/b/c", &filer_pb.RemoteStorageLocation{+ Name: "s7",+ Bucket: "some",+ Path: "/dir",+ })_, _, found := rs.FindRemoteStorageClient("/a/b/c/d/e/f")assert.Equal(t, true, found, "find storage client")diff --git a/weed/shell/command_remote_mount.go b/weed/shell/command_remote_mount.goindex bd6b490504..55dfb42ca8 100644--- a/weed/shell/command_remote_mount.go+++ b/weed/shell/command_remote_mount.go@@ -130,17 +130,15 @@ func (c *commandRemoteMount) findRemoteStorageConfiguration(commandEnv *CommandEfunc (c *commandRemoteMount) pullMetadata(commandEnv *CommandEnv, writer io.Writer, dir string, nonEmpty bool, remoteConf *filer_pb.RemoteConf, remote *filer_pb.RemoteStorageLocation) error {// find existing directory, and ensure the directory is empty- var mountToDir *filer_pb.Entryerr := commandEnv.WithFilerClient(func(client filer_pb.SeaweedFilerClient) error {parent, name := util.FullPath(dir).DirAndName()- resp, lookupErr := client.LookupDirectoryEntry(context.Background(), &filer_pb.LookupDirectoryEntryRequest{+ _, lookupErr := client.LookupDirectoryEntry(context.Background(), &filer_pb.LookupDirectoryEntryRequest{Directory: parent,Name: name,})if lookupErr != nil {return fmt.Errorf("lookup %s: %v", dir, lookupErr)}- mountToDir = resp.EntrymountToDirIsEmpty := truelistErr := filer_pb.SeaweedList(client, dir, "", func(entry *filer_pb.Entry, isLast bool) error {