mirror of https://github.com/k3s-io/k3s
Merge pull request #27042 from lukaszo/logs
Automatic merge from submit-queue Fix kubectl logs for init containerspull/6/head
commit
983b478ff4
|
@ -2720,6 +2720,10 @@ func (kl *Kubelet) validateContainerLogStatus(podName string, podStatus *api.Pod
|
||||||
var cID string
|
var cID string
|
||||||
|
|
||||||
cStatus, found := api.GetContainerStatus(podStatus.ContainerStatuses, containerName)
|
cStatus, found := api.GetContainerStatus(podStatus.ContainerStatuses, containerName)
|
||||||
|
// if not found, check the init containers
|
||||||
|
if !found {
|
||||||
|
cStatus, found = api.GetContainerStatus(podStatus.InitContainerStatuses, containerName)
|
||||||
|
}
|
||||||
if !found {
|
if !found {
|
||||||
return kubecontainer.ContainerID{}, fmt.Errorf("container %q in pod %q is not available", containerName, podName)
|
return kubecontainer.ContainerID{}, fmt.Errorf("container %q in pod %q is not available", containerName, podName)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue