Skip to content
This repository has been archived by the owner on Apr 3, 2018. It is now read-only.

Commit

Permalink
Run cc-shim in the network namespace of pod
Browse files Browse the repository at this point in the history
Signed-off-by: Yanqiang Miao <[email protected]>
  • Loading branch information
Yanqiang Miao committed Feb 13, 2018
1 parent 9a81686 commit 7b6db3d
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion shim.go
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,18 @@ func prepareAndStartShim(pod *Pod, shim shim, cid, token, url string, cmd Cmd) (
Detach: cmd.Detach,
}

pid, err := shim.start(*pod, shimParams)
fs := &filesystem{}
netNS, err := fs.fetchPodNetwork(pod.ID())
if err != nil {
return nil, err
}

var pid int
err = pod.network.run(netNS.NetNsPath, func() error {
var shimErr error
pid, shimErr = shim.start(*pod, shimParams)
return shimErr
})
if err != nil {
return nil, err
}
Expand Down

0 comments on commit 7b6db3d

Please sign in to comment.