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

Commit

Permalink
Merge pull request #618 from miaoyq/move-cc-shim-to-pod-netns
Browse files Browse the repository at this point in the history
Run cc-shim in the network namespace of pod
  • Loading branch information
Sebastien Boeuf authored Feb 13, 2018
2 parents 6621b5d + 195d71f commit 27e2964
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion shim.go
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,16 @@ func prepareAndStartShim(pod *Pod, shim shim, cid, token, url string, cmd Cmd) (
Detach: cmd.Detach,
}

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

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

0 comments on commit 27e2964

Please sign in to comment.