diff --git a/pkg/kubelet/dockertools/manager.go b/pkg/kubelet/dockertools/manager.go index d71d101fbc3..b36f14d66f6 100644 --- a/pkg/kubelet/dockertools/manager.go +++ b/pkg/kubelet/dockertools/manager.go @@ -1724,8 +1724,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: diff --git a/pkg/kubelet/rkt/rkt.go b/pkg/kubelet/rkt/rkt.go index 1f9c9a13b13..0ef700bc606 100644 --- a/pkg/kubelet/rkt/rkt.go +++ b/pkg/kubelet/rkt/rkt.go @@ -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