From 63d5c0df6a12a077d4db5ffee33942dfc198eda3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Friedrich=20Dreyer?= Date: Tue, 11 Jan 2022 14:58:06 +0000 Subject: [PATCH] fix shares provider filter MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Jörn Friedrich Dreyer --- changelog/unreleased/fix-shares-provider-filter.md | 5 +++++ .../sharesstorageprovider/sharesstorageprovider.go | 9 +++++---- 2 files changed, 10 insertions(+), 4 deletions(-) create mode 100644 changelog/unreleased/fix-shares-provider-filter.md diff --git a/changelog/unreleased/fix-shares-provider-filter.md b/changelog/unreleased/fix-shares-provider-filter.md new file mode 100644 index 0000000000..d60acf888a --- /dev/null +++ b/changelog/unreleased/fix-shares-provider-filter.md @@ -0,0 +1,5 @@ +Bugfix: fix shares provider filter + +The shares storage provider now correctly filters space types + +https://github.com/cs3org/reva/pull/2433 diff --git a/internal/grpc/services/sharesstorageprovider/sharesstorageprovider.go b/internal/grpc/services/sharesstorageprovider/sharesstorageprovider.go index 816f8c4efa..3a6f7166d3 100644 --- a/internal/grpc/services/sharesstorageprovider/sharesstorageprovider.go +++ b/internal/grpc/services/sharesstorageprovider/sharesstorageprovider.go @@ -317,14 +317,15 @@ func (s *service) ListStorageSpaces(ctx context.Context, req *provider.ListStora case provider.ListStorageSpacesRequest_Filter_TYPE_SPACE_TYPE: spaceType := f.GetSpaceType() // do we need to fetch the shares? - if spaceType == "mountpoint" || spaceType == "grant" { - spaceTypes[spaceType] = exists - fetchShares = true - } if spaceType == "+mountpoint" || spaceType == "+grant" { appendTypes = append(appendTypes, strings.TrimPrefix(spaceType, "+")) fetchShares = true + continue + } + if spaceType == "mountpoint" || spaceType == "grant" { + fetchShares = true } + spaceTypes[spaceType] = exists case provider.ListStorageSpacesRequest_Filter_TYPE_ID: spaceid, shareid, err := utils.SplitStorageSpaceID(f.GetId().OpaqueId) if err != nil {