mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-31 07:20:13 +00:00
Merge pull request #16945 from kargakis/kubelet-fallback-to-apiserver
kubelet: Fallback to api server for pod status
This commit is contained in:
commit
8a8f394f0d
@ -2308,7 +2308,10 @@ func (kl *Kubelet) GetKubeletContainerLogs(podFullName, containerName string, lo
|
||||
}
|
||||
podStatus, found := kl.statusManager.GetPodStatus(podUID)
|
||||
if !found {
|
||||
return fmt.Errorf("failed to get status for pod %q in namespace %q", name, namespace)
|
||||
// If there is no cached status, use the status from the
|
||||
// apiserver. This is useful if kubelet has recently been
|
||||
// restarted.
|
||||
podStatus = pod.Status
|
||||
}
|
||||
|
||||
if err := kl.validatePodPhase(&podStatus); err != nil {
|
||||
|
Loading…
Reference in New Issue
Block a user