Merge pull request #15177 from timstclair/restart-policy

Auto commit by PR queue bot
This commit is contained in:
k8s-merge-robot 2015-10-09 09:41:22 -07:00
commit 273c9ce503
2 changed files with 5 additions and 3 deletions

View File

@ -1737,8 +1737,10 @@ func (dm *DockerManager) computePodContainerChanges(pod *api.Pod, runningPod kub
containersToKeep[containerID] = index
continue
}
glog.Infof("pod %q container %q is unhealthy (probe result: %v), it will be killed and re-created.", podFullName, container.Name, result)
containersToStart[index] = empty{}
if pod.Spec.RestartPolicy != api.RestartPolicyNever {
glog.Infof("pod %q container %q is unhealthy (probe result: %v), it will be killed and re-created.", podFullName, container.Name, result)
containersToStart[index] = empty{}
}
}
// After the loop one of the following should be true:

View File

@ -1013,7 +1013,7 @@ func (r *Runtime) SyncPod(pod *api.Pod, runningPod kubecontainer.Pod, podStatus
result, err := r.prober.ProbeLiveness(pod, podStatus, container, c.ID, c.Created)
// TODO(vmarmol): examine this logic.
if err == nil && result != probe.Success {
if err == nil && result != probe.Success && pod.Spec.RestartPolicy != api.RestartPolicyNever {
glog.Infof("Pod %q container %q is unhealthy (probe result: %v), it will be killed and re-created.", podFullName, container.Name, result)
restartPod = true
break