Allow starting a container with --net=host.

pull/6/head
Victor Marmol 2015-03-23 15:32:55 -07:00
parent 5eb373692b
commit d9cd7a78f7
1 changed files with 6 additions and 1 deletions

View File

@ -1040,7 +1040,12 @@ func (kl *Kubelet) createPodInfraContainer(pod *api.Pod) (dockertools.DockerID,
if ref != nil {
kl.recorder.Eventf(ref, "pulled", "Successfully pulled image %q", container.Image)
}
id, err := kl.runContainer(pod, container, nil, "", "")
// TODO(vmarmol): Auth.
netNamespace := ""
if pod.Spec.HostNetwork {
netNamespace = "host"
}
id, err := kl.runContainer(pod, container, nil, netNamespace, "")
if err != nil {
return "", err
}