kubelet: fix getting logs from static pods

This change adds the necessary UID translation logic to fix the issue.
This commit is contained in:
Yu-Ju Hong 2015-10-23 14:31:40 -07:00
parent 038f871c43
commit e4f739115f

View File

@ -2211,7 +2211,11 @@ func (kl *Kubelet) GetKubeletContainerLogs(podFullName, containerName string, lo
return fmt.Errorf("unable to get logs for container %q in pod %q namespace %q: unable to find pod", containerName, name, namespace)
}
podStatus, found := kl.statusManager.GetPodStatus(pod.UID)
podUID := pod.UID
if mirrorPod, ok := kl.podManager.GetMirrorPodByPod(pod); ok {
podUID = mirrorPod.UID
}
podStatus, found := kl.statusManager.GetPodStatus(podUID)
if !found {
return fmt.Errorf("failed to get status for pod %q in namespace %q", name, namespace)
}