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.
This commit is contained in:
parent
804109d349
commit
c94e134ae4
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user