Return logs for failed and succeeded pods too.

pull/6/head
Brendan Burns 2015-02-12 18:02:36 -08:00
parent 4d141025da
commit 8b7dfc9359
1 changed files with 5 additions and 2 deletions

View File

@ -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)
}
}
if podStatus.Phase != api.PodRunning {
return fmt.Errorf("pod %q is not in 'Running' state - State: %q", podFullName, podStatus.Phase)
switch 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
dockerContainerID := ""