mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-31 07:20:13 +00:00
kubelet: fix getting logs from static pods
This change adds the necessary UID translation logic to fix the issue.
This commit is contained in:
parent
038f871c43
commit
e4f739115f
@ -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)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user