Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

kubelet: Fallback to api server for pod status #16945

Merged
merged 1 commit into from
Nov 9, 2015
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 4 additions & 1 deletion pkg/kubelet/kubelet.go
Original file line number Diff line number Diff line change
Expand Up @@ -2311,7 +2311,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 {
Expand Down