mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-23 11:50:44 +00:00
Fix returning logs from ephemeral containers
This commit is contained in:
parent
b5d592e735
commit
cb3976c02b
@ -1108,10 +1108,12 @@ func (kl *Kubelet) validateContainerLogStatus(podName string, podStatus *v1.PodS
|
||||
var cID string
|
||||
|
||||
cStatus, found := podutil.GetContainerStatus(podStatus.ContainerStatuses, containerName)
|
||||
// if not found, check the init containers
|
||||
if !found {
|
||||
cStatus, found = podutil.GetContainerStatus(podStatus.InitContainerStatuses, containerName)
|
||||
}
|
||||
if !found && utilfeature.DefaultFeatureGate.Enabled(features.EphemeralContainers) {
|
||||
cStatus, found = podutil.GetContainerStatus(podStatus.EphemeralContainerStatuses, containerName)
|
||||
}
|
||||
if !found {
|
||||
return kubecontainer.ContainerID{}, fmt.Errorf("container %q in pod %q is not available", containerName, podName)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user