Always restart container in unknown state.

This commit is contained in:
Lantao Liu
2016-03-05 10:40:25 +00:00
parent 271784e5fa
commit 45064d7a1e
3 changed files with 14 additions and 2 deletions

View File

@@ -57,6 +57,10 @@ func ShouldContainerBeRestarted(container *api.Container, pod *api.Pod, podStatu
if status.State == ContainerStateRunning {
return false
}
// Always restart container in unknown state now
if status.State == ContainerStateUnknown {
return true
}
// Check RestartPolicy for dead container
if pod.Spec.RestartPolicy == api.RestartPolicyNever {
glog.V(4).Infof("Already ran container %q of pod %q, do nothing", container.Name, format.Pod(pod))