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

Run cc-shim in the network namespace of pod #618

Merged
merged 1 commit into from
Feb 13, 2018
Merged
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
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