mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-25 04:33:26 +00:00
Return logs for failed and succeeded pods too.
This commit is contained in:
parent
4d141025da
commit
8b7dfc9359
@ -1423,8 +1423,11 @@ func (kl *Kubelet) GetKubeletContainerLogs(podFullName, containerName, tail stri
|
|||||||
return fmt.Errorf("failed to get status for pod %q - %v", podFullName, err)
|
return fmt.Errorf("failed to get status for pod %q - %v", podFullName, err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if podStatus.Phase != api.PodRunning {
|
switch podStatus.Phase {
|
||||||
return fmt.Errorf("pod %q is not in 'Running' state - State: %q", podFullName, podStatus.Phase)
|
case api.PodRunning, api.PodSucceeded, api.PodFailed:
|
||||||
|
break
|
||||||
|
default:
|
||||||
|
return fmt.Errorf("pod %q is not in 'Running', 'Succeeded' or 'Failed' state - State: %q", podFullName, podStatus.Phase)
|
||||||
}
|
}
|
||||||
exists := false
|
exists := false
|
||||||
dockerContainerID := ""
|
dockerContainerID := ""
|
||||||
|
Loading…
Reference in New Issue
Block a user