Merge pull request #34669 from yujuhong/get_netns

Automatic merge from submit-queue

Allow kuberuntime to get network namespace for not ready sandboxes

Kubelet calls TearDownPod to clean up the network resources for a pod sandbox.
TearDownPod relies on GetNetNS to retrieve network namespace, and the current
implementation makes this impossible for not-ready sandboxes. This change
removes the unnecessary filter to fix this issue.
This commit is contained in:
Kubernetes Submit Queue 2016-10-12 23:09:08 -07:00 committed by GitHub
commit a0624835ac

View File

@ -941,9 +941,7 @@ func (m *kubeGenericRuntimeManager) GetPodStatus(uid kubetypes.UID, name, namesp
// TODO: Rename param name to sandboxID in kubecontainer.Runtime.GetNetNS().
// TODO: Remove GetNetNS after networking is delegated to the container runtime.
func (m *kubeGenericRuntimeManager) GetNetNS(sandboxID kubecontainer.ContainerID) (string, error) {
readyState := runtimeApi.PodSandBoxState_READY
filter := &runtimeApi.PodSandboxFilter{
State: &readyState,
Id: &sandboxID.ID,
LabelSelector: map[string]string{kubernetesManagedLabel: "true"},
}