Skip to content

Commit

Permalink
Merge pull request #4480 from micbar/revert-cross-storage-move
Browse files Browse the repository at this point in the history
fix: revert the status code denied moves
  • Loading branch information
micbar committed Jan 26, 2024
2 parents bec9d4c + fb514b7 commit 22272e6
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 10 deletions.
6 changes: 0 additions & 6 deletions changelog/unreleased/fix-statuscode-move-denied.md

This file was deleted.

2 changes: 1 addition & 1 deletion internal/grpc/services/gateway/storageprovider.go
Original file line number Diff line number Diff line change
Expand Up @@ -709,7 +709,7 @@ func (s *svc) Move(ctx context.Context, req *provider.MoveRequest) (*provider.Mo

if sourceProviderInfo.Address != destProviderInfo.Address {
return &provider.MoveResponse{
Status: status.NewPermissionDenied(ctx, nil, "cross storage moves are not permitted, use copy and delete"),
Status: status.NewUnimplemented(ctx, nil, "cross storage moves are not supported, use copy and delete"),
}, nil
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -667,7 +667,7 @@ func (s *service) Move(ctx context.Context, req *provider.MoveRequest) (*provide

if dstReceivedShare.Share.Id.OpaqueId != srcReceivedShare.Share.Id.OpaqueId {
return &provider.MoveResponse{
Status: status.NewPermissionDenied(ctx, nil, "cross storage moves are not permitted, use copy and delete"),
Status: status.NewUnimplemented(ctx, nil, "cross storage moves are not supported, use copy and delete"),
}, nil
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -808,7 +808,7 @@ var _ = Describe("Sharesstorageprovider", func() {
gatewayClient.AssertNotCalled(GinkgoT(), "Move", mock.Anything, mock.Anything)
Expect(err).ToNot(HaveOccurred())
Expect(res).ToNot(BeNil())
Expect(res.Status.Code).To(Equal(rpc.Code_CODE_PERMISSION_DENIED))
Expect(res.Status.Code).To(Equal(rpc.Code_CODE_UNIMPLEMENTED))
})

It("refuses to move a file between shares resolving to the same space", func() {
Expand All @@ -826,7 +826,7 @@ var _ = Describe("Sharesstorageprovider", func() {
gatewayClient.AssertNotCalled(GinkgoT(), "Move", mock.Anything, mock.Anything)
Expect(err).ToNot(HaveOccurred())
Expect(res).ToNot(BeNil())
Expect(res.Status.Code).To(Equal(rpc.Code_CODE_PERMISSION_DENIED))
Expect(res.Status.Code).To(Equal(rpc.Code_CODE_UNIMPLEMENTED))
})

It("moves a file", func() {
Expand Down

0 comments on commit 22272e6

Please sign in to comment.