Check pod RestartPolicy before restarting unhealthy containers
This commit is contained in:
@@ -1022,7 +1022,7 @@ func (r *runtime) SyncPod(pod *api.Pod, runningPod kubecontainer.Pod, podStatus
|
||||
|
||||
result, err := r.prober.ProbeLiveness(pod, podStatus, container, string(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
|
||||
|
Reference in New Issue
Block a user