Skip to content

Commit

Permalink
[ws-daemon] Log instance ID with all nsinsider ops
Browse files Browse the repository at this point in the history
  • Loading branch information
csweichel committed Jul 13, 2021
1 parent b5be41f commit 700b8f8
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions components/ws-daemon/pkg/iws/iws.go
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,7 @@ func (wbs *InWorkspaceServiceServer) MountProc(ctx context.Context, req *api.Mou
}
}

err = moveMount(int(procPID), nodeStaging, req.Target)
err = moveMount(wbs.Session.InstanceID, int(procPID), nodeStaging, req.Target)
if err != nil {
return nil, err
}
Expand Down Expand Up @@ -506,15 +506,15 @@ func (wbs *InWorkspaceServiceServer) UmountProc(ctx context.Context, req *api.Um
return &api.UmountProcResponse{}, nil
}

func moveMount(targetPid int, source, target string) error {
func moveMount(instanceID string, targetPid int, source, target string) error {
mntfd, err := syscallOpenTree(unix.AT_FDCWD, source, flagOpenTreeClone|flagAtRecursive)
if err != nil {
return xerrors.Errorf("cannot open tree: %w", err)
}
mntf := os.NewFile(mntfd, "")
defer mntf.Close()

err = nsinsider("", targetPid, func(c *exec.Cmd) {
err = nsinsider(instanceID, targetPid, func(c *exec.Cmd) {
c.Args = append(c.Args, "move-mount", "--target", target, "--pipe-fd", "3")
c.ExtraFiles = append(c.ExtraFiles, mntf)
})
Expand Down

0 comments on commit 700b8f8

Please sign in to comment.