Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

move unwrapping and wrapping of paths to the gateway #1866

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 12 additions & 6 deletions internal/grpc/services/gateway/ocmshareprovider.go
Original file line number Diff line number Diff line change
Expand Up @@ -342,19 +342,25 @@ func (s *svc) createOCMReference(ctx context.Context, share *ocm.Share) (*rpc.St
}

log.Info().Msg("mount path will be:" + refPath)
createRefReq := &provider.CreateReferenceRequest{
Ref: &provider.Reference{Path: refPath},
TargetUri: targetURI,
}

c, err := s.findByPath(ctx, refPath)
c, p, err := s.findByPath(ctx, refPath)
if err != nil {
if _, ok := err.(errtypes.IsNotFound); ok {
return status.NewNotFound(ctx, "storage provider not found"), nil
}
return status.NewInternal(ctx, err, "error finding storage provider"), nil
}

pRef, err := unwrap(&provider.Reference{Path: refPath}, p.ProviderPath)
if err != nil {
log.Err(err).Msg("gateway: error unwrapping")
return &rpc.Status{
Code: rpc.Code_CODE_INTERNAL,
}, nil
}
createRefReq := &provider.CreateReferenceRequest{
Ref: pRef,
TargetUri: targetURI,
}
createRefRes, err := c.CreateReference(ctx, createRefReq)
if err != nil {
log.Err(err).Msg("gateway: error calling GetHome")
Expand Down
Loading