diff --git a/accounts/pkg/storage/cs3.go b/accounts/pkg/storage/cs3.go index f628f538f4..4acebf4620 100644 --- a/accounts/pkg/storage/cs3.go +++ b/accounts/pkg/storage/cs3.go @@ -102,7 +102,7 @@ func (r CS3Repo) LoadAccounts(ctx context.Context, a *[]*proto.Account) (err err res, err := r.storageProvider.ListContainer(ctx, &provider.ListContainerRequest{ Ref: &provider.Reference{ - Path: path.Join(storageMountPath, accountsFolder), + Path: path.Join("/", accountsFolder), }, }) if err != nil { @@ -142,7 +142,7 @@ func (r CS3Repo) DeleteAccount(ctx context.Context, id string) (err error) { resp, err := r.storageProvider.Delete(ctx, &provider.DeleteRequest{ Ref: &provider.Reference{ - Path: path.Join(storageMountPath, accountsFolder, id), + Path: path.Join("/", accountsFolder, id), }, }) @@ -197,7 +197,7 @@ func (r CS3Repo) LoadGroups(ctx context.Context, g *[]*proto.Group) (err error) res, err := r.storageProvider.ListContainer(ctx, &provider.ListContainerRequest{ Ref: &provider.Reference{ - Path: path.Join(storageMountPath, groupsFolder), + Path: path.Join("/", groupsFolder), }, }) if err != nil { @@ -237,7 +237,7 @@ func (r CS3Repo) DeleteGroup(ctx context.Context, id string) (err error) { resp, err := r.storageProvider.Delete(ctx, &provider.DeleteRequest{ Ref: &provider.Reference{ - Path: path.Join(storageMountPath, groupsFolder, id), + Path: path.Join("/", groupsFolder, id), }, }) @@ -295,7 +295,7 @@ func (r CS3Repo) makeRootDirIfNotExist(ctx context.Context, folder string) error // MakeDirIfNotExist will create a root node in the metadata storage. Requires an authenticated context. func MakeDirIfNotExist(ctx context.Context, sp provider.ProviderAPIClient, folder string) error { var rootPathRef = &provider.Reference{ - Path: path.Join(storageMountPath, folder), + Path: path.Join("/", folder), } resp, err := sp.Stat(ctx, &provider.StatRequest{ diff --git a/ocis-pkg/indexer/index/cs3/autoincrement.go b/ocis-pkg/indexer/index/cs3/autoincrement.go index 1b223a7ed0..99a3424285 100644 --- a/ocis-pkg/indexer/index/cs3/autoincrement.go +++ b/ocis-pkg/indexer/index/cs3/autoincrement.go @@ -162,7 +162,7 @@ func (idx *Autoincrement) Remove(id string, v string) error { return err } - deletePath := path.Join("/meta", idx.indexRootDir, v) + deletePath := path.Join("/", idx.indexRootDir, v) resp, err := idx.storageProvider.Delete(ctx, &provider.DeleteRequest{ Ref: &provider.Reference{ Path: deletePath, @@ -203,7 +203,7 @@ func (idx *Autoincrement) Search(pattern string) ([]string, error) { res, err := idx.storageProvider.ListContainer(ctx, &provider.ListContainerRequest{ Ref: &provider.Reference{ - Path: path.Join("/meta", idx.indexRootDir), + Path: path.Join("/", idx.indexRootDir), }, }) @@ -301,7 +301,11 @@ func (idx *Autoincrement) next() (int, error) { res, err := idx.storageProvider.ListContainer(ctx, &provider.ListContainerRequest{ Ref: &provider.Reference{ +<<<<<<< HEAD Path: path.Join("/meta", idx.indexRootDir), //TODO: +======= + Path: path.Join("/", idx.indexRootDir), +>>>>>>> 7a5fb4c2e (drop /meta mount prefix) }, }) diff --git a/ocis-pkg/indexer/index/cs3/helper.go b/ocis-pkg/indexer/index/cs3/helper.go index 4cf5109d33..127b839c15 100644 --- a/ocis-pkg/indexer/index/cs3/helper.go +++ b/ocis-pkg/indexer/index/cs3/helper.go @@ -12,7 +12,7 @@ import ( func deleteIndexRoot(ctx context.Context, storageProvider provider.ProviderAPIClient, indexRootDir string) error { res, err := storageProvider.Delete(ctx, &provider.DeleteRequest{ Ref: &provider.Reference{ - Path: path.Join("/meta", indexRootDir), + Path: path.Join("/", indexRootDir), }, }) if err != nil { diff --git a/ocis-pkg/indexer/index/cs3/non_unique.go b/ocis-pkg/indexer/index/cs3/non_unique.go index 8976199fc5..7b8f566278 100644 --- a/ocis-pkg/indexer/index/cs3/non_unique.go +++ b/ocis-pkg/indexer/index/cs3/non_unique.go @@ -119,7 +119,7 @@ func (idx *NonUnique) Lookup(v string) ([]string, error) { res, err := idx.storageProvider.ListContainer(ctx, &provider.ListContainerRequest{ Ref: &provider.Reference{ - Path: path.Join("/meta", idx.indexRootDir, v), + Path: path.Join("/", idx.indexRootDir, v), }, }) @@ -172,7 +172,7 @@ func (idx *NonUnique) Remove(id string, v string) error { return err } - deletePath := path.Join("/meta", idx.indexRootDir, v, id) + deletePath := path.Join("/", idx.indexRootDir, v, id) resp, err := idx.storageProvider.Delete(ctx, &provider.DeleteRequest{ Ref: &provider.Reference{ Path: deletePath, @@ -187,7 +187,7 @@ func (idx *NonUnique) Remove(id string, v string) error { return &idxerrs.NotFoundErr{TypeName: idx.typeName, Key: idx.indexBy, Value: v} } - toStat := path.Join("/meta", idx.indexRootDir, v) + toStat := path.Join("/", idx.indexRootDir, v) lcResp, err := idx.storageProvider.ListContainer(ctx, &provider.ListContainerRequest{ Ref: &provider.Reference{ Path: toStat, @@ -198,7 +198,7 @@ func (idx *NonUnique) Remove(id string, v string) error { } if len(lcResp.Infos) == 0 { - deletePath = path.Join("/meta", idx.indexRootDir, v) + deletePath = path.Join("/", idx.indexRootDir, v) _, err := idx.storageProvider.Delete(ctx, &provider.DeleteRequest{ Ref: &provider.Reference{ Path: deletePath, @@ -245,7 +245,7 @@ func (idx *NonUnique) Search(pattern string) ([]string, error) { matches := make([]string, 0) res, err := idx.storageProvider.ListContainer(ctx, &provider.ListContainerRequest{ Ref: &provider.Reference{ - Path: path.Join("/meta", idx.indexRootDir), + Path: path.Join("/", idx.indexRootDir), }, }) diff --git a/ocis-pkg/indexer/index/cs3/non_unique_test.go b/ocis-pkg/indexer/index/cs3/non_unique_test.go index c98a1574a1..3dd0527daf 100644 --- a/ocis-pkg/indexer/index/cs3/non_unique_test.go +++ b/ocis-pkg/indexer/index/cs3/non_unique_test.go @@ -32,7 +32,7 @@ package cs3 // sut := NewNonUniqueIndexWithOptions( // option.WithTypeName(GetTypeFQN(User{})), // option.WithIndexBy("UserName"), -// option.WithFilesDir(path.Join(cfg.Repo.Disk.Path, "/meta")), +// option.WithFilesDir(path.Join(cfg.Repo.Disk.Path, "/")), // option.WithDataDir(cfg.Repo.Disk.Path), // option.WithDataURL(cfg.Repo.CS3.DataURL), // option.WithDataPrefix(cfg.Repo.CS3.DataPrefix), diff --git a/ocis-pkg/indexer/index/cs3/unique.go b/ocis-pkg/indexer/index/cs3/unique.go index 7114d4fcf5..2c92da6415 100644 --- a/ocis-pkg/indexer/index/cs3/unique.go +++ b/ocis-pkg/indexer/index/cs3/unique.go @@ -162,7 +162,12 @@ func (idx *Unique) Remove(id string, v string) error { return err } +<<<<<<< HEAD deletePath := path.Join("/meta", idx.indexRootDir, v) +======= + deletePath := path.Join("/", idx.indexRootDir, v) + ctx = metadata.AppendToOutgoingContext(ctx, revactx.TokenHeader, t) +>>>>>>> 7a5fb4c2e (drop /meta mount prefix) resp, err := idx.storageProvider.Delete(ctx, &provider.DeleteRequest{ Ref: &provider.Reference{ Path: deletePath, @@ -212,7 +217,7 @@ func (idx *Unique) Search(pattern string) ([]string, error) { res, err := idx.storageProvider.ListContainer(ctx, &provider.ListContainerRequest{ Ref: &provider.Reference{ - Path: path.Join("/meta", idx.indexRootDir), + Path: path.Join("/", idx.indexRootDir), }, }) diff --git a/ocis-pkg/indexer/index/cs3/unique_test.go b/ocis-pkg/indexer/index/cs3/unique_test.go index a1a7edb7da..6c282e9085 100644 --- a/ocis-pkg/indexer/index/cs3/unique_test.go +++ b/ocis-pkg/indexer/index/cs3/unique_test.go @@ -32,7 +32,7 @@ package cs3 // sut := NewUniqueIndexWithOptions( // option.WithTypeName(GetTypeFQN(User{})), // option.WithIndexBy("UserName"), -// option.WithFilesDir(path.Join(cfg.Repo.Disk.Path, "/meta")), +// option.WithFilesDir(path.Join(cfg.Repo.Disk.Path, "/")), // option.WithDataDir(cfg.Repo.Disk.Path), // option.WithDataURL(cfg.Repo.CS3.DataURL), // option.WithDataPrefix(cfg.Repo.CS3.DataPrefix), @@ -82,7 +82,7 @@ package cs3 // sut := NewUniqueIndexWithOptions( // option.WithTypeName(GetTypeFQN(User{})), // option.WithIndexBy("UserName"), -// option.WithFilesDir(path.Join(cfg.Repo.Disk.Path, "/meta")), +// option.WithFilesDir(path.Join(cfg.Repo.Disk.Path, "/")), // option.WithDataDir(cfg.Repo.Disk.Path), // option.WithDataURL(cfg.Repo.CS3.DataURL), // option.WithDataPrefix(cfg.Repo.CS3.DataPrefix),