Skip to content

Commit

Permalink
augment the id of newly created spaces
Browse files Browse the repository at this point in the history
  • Loading branch information
David Christofas committed Oct 12, 2021
1 parent 5dbb87c commit a864348
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
5 changes: 5 additions & 0 deletions changelog/unreleased/augment-spaces-id.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Enhancement: Augment the Id of new spaces

Newly created spaces were missing the Root reference and the storage id in the space id.

https://github.com/cs3org/reva/issues/2158
9 changes: 8 additions & 1 deletion internal/grpc/services/storageprovider/storageprovider.go
Original file line number Diff line number Diff line change
Expand Up @@ -433,7 +433,14 @@ func (s *service) CreateHome(ctx context.Context, req *provider.CreateHomeReques

// CreateStorageSpace creates a storage space
func (s *service) CreateStorageSpace(ctx context.Context, req *provider.CreateStorageSpaceRequest) (*provider.CreateStorageSpaceResponse, error) {
return s.storage.CreateStorageSpace(ctx, req)
resp, err := s.storage.CreateStorageSpace(ctx, req)
if err != nil {
return nil, err
}

resp.StorageSpace.Root = &provider.ResourceId{StorageId: s.mountID, OpaqueId: resp.StorageSpace.Id.OpaqueId}
resp.StorageSpace.Id = &provider.StorageSpaceId{OpaqueId: s.mountID + "!" + resp.StorageSpace.Id.OpaqueId}
return resp, nil
}

func hasNodeID(s *provider.StorageSpace) bool {
Expand Down

0 comments on commit a864348

Please sign in to comment.