Merge pull request #15194 from MikaelCluseau/wip-issue-15187
Auto commit by PR queue bot
This commit is contained in:
commit
6269e22858
@ -1882,14 +1882,16 @@ func (dm *DockerManager) SyncPod(pod *api.Pod, runningPod kubecontainer.Pod, pod
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
// Setup the host interface (FIXME: move to networkPlugin when ready)
|
// Setup the host interface unless the pod is on the host's network (FIXME: move to networkPlugin when ready)
|
||||||
podInfraContainer, err := dm.client.InspectContainer(string(podInfraContainerID))
|
podInfraContainer, err := dm.client.InspectContainer(string(podInfraContainerID))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
glog.Errorf("Failed to inspect pod infra container: %v; Skipping pod %q", err, podFullName)
|
glog.Errorf("Failed to inspect pod infra container: %v; Skipping pod %q", err, podFullName)
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
if err = hairpin.SetUpContainer(podInfraContainer.State.Pid, "eth0"); err != nil {
|
if !(pod.Spec.SecurityContext != nil && pod.Spec.SecurityContext.HostNetwork) {
|
||||||
glog.Warningf("Hairpin setup failed for pod %q: %v", podFullName, err)
|
if err = hairpin.SetUpContainer(podInfraContainer.State.Pid, "eth0"); err != nil {
|
||||||
|
glog.Warningf("Hairpin setup failed for pod %q: %v", podFullName, err)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if podDependsOnPodIP(pod) {
|
if podDependsOnPodIP(pod) {
|
||||||
// Find the pod IP after starting the infra container in order to expose
|
// Find the pod IP after starting the infra container in order to expose
|
||||||
|
@ -64,7 +64,7 @@ func findPairInterfaceOfContainerInterface(e exec.Interface, containerPid int, c
|
|||||||
// Get container's interface index
|
// Get container's interface index
|
||||||
output, err := e.Command(nsenterPath, "-t", fmt.Sprintf("%d", containerPid), "-n", "-F", "--", ethtoolPath, "--statistics", containerInterfaceName).CombinedOutput()
|
output, err := e.Command(nsenterPath, "-t", fmt.Sprintf("%d", containerPid), "-n", "-F", "--", ethtoolPath, "--statistics", containerInterfaceName).CombinedOutput()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return "", fmt.Errorf("Unable to query interface %s of container %d: %v", containerInterfaceName, containerPid, err)
|
return "", fmt.Errorf("Unable to query interface %s of container %d: %v: %s", containerInterfaceName, containerPid, err, string(output))
|
||||||
}
|
}
|
||||||
// look for peer_ifindex
|
// look for peer_ifindex
|
||||||
match := ethtoolOutputRegex.FindSubmatch(output)
|
match := ethtoolOutputRegex.FindSubmatch(output)
|
||||||
|
Loading…
Reference in New Issue
Block a user