From 1947fdb7be93de03e218d8a4111a2690cc0f5bc4 Mon Sep 17 00:00:00 2001 From: Roman Perekhod Date: Mon, 24 Feb 2025 10:48:53 +0100 Subject: [PATCH] Fix OCM create share --- changelog/unreleased/fix-ocm-create-share.md | 6 ++++++ internal/grpc/services/gateway/ocmshareprovider.go | 3 +++ 2 files changed, 9 insertions(+) create mode 100644 changelog/unreleased/fix-ocm-create-share.md diff --git a/changelog/unreleased/fix-ocm-create-share.md b/changelog/unreleased/fix-ocm-create-share.md new file mode 100644 index 0000000000..d3f408a74b --- /dev/null +++ b/changelog/unreleased/fix-ocm-create-share.md @@ -0,0 +1,6 @@ +Bugfix: Fix OCM create share + +We fixed the OCM share fails on share creating if the federated instance is not reachable. + +https://github.com/cs3org/reva/pull/5093 +https://github.com/owncloud/ocis/issues/11046 diff --git a/internal/grpc/services/gateway/ocmshareprovider.go b/internal/grpc/services/gateway/ocmshareprovider.go index 4f8b943157..a57d151740 100644 --- a/internal/grpc/services/gateway/ocmshareprovider.go +++ b/internal/grpc/services/gateway/ocmshareprovider.go @@ -56,6 +56,9 @@ func (s *svc) CreateOCMShare(ctx context.Context, req *ocm.CreateOCMShareRequest if err != nil { return nil, errors.Wrap(err, "gateway: error calling CreateOCMShare") } + if res.GetStatus().GetCode() != rpc.Code_CODE_OK { + return res, nil + } // add a grant to the storage provider so the share can efficiently be listed // the grant does not grant any permissions. access is granted by the OCM link token