Commit c94e134a authored by Euan Kemp's avatar Euan Kemp Committed by Euan Kemp

dockertools: Don't use network plugin if net=host

This was already handled in most places. I think this is the only remaining instance of it in the docker package. This could lead to confusing results. E.g. if `networkPlugin` was cni, it could lead to error logs about not getting network status for host pods if eth0 didn't exist on the host.
parent 804109d3
......@@ -344,7 +344,11 @@ func (dm *DockerManager) determineContainerIP(podNamespace, podName string, cont
}
}
if dm.networkPlugin.Name() != network.DefaultPluginName {
networkMode := getDockerNetworkMode(container)
isHostNetwork := networkMode == namespaceModeHost
// For host networking or default network plugin, GetPodNetworkStatus doesn't work
if !isHostNetwork && dm.networkPlugin.Name() != network.DefaultPluginName {
netStatus, err := dm.networkPlugin.GetPodNetworkStatus(podNamespace, podName, kubecontainer.DockerID(container.ID).ContainerID())
if err != nil {
glog.Errorf("NetworkPlugin %s failed on the status hook for pod '%s' - %v", dm.networkPlugin.Name(), podName, err)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment