mirror of https://github.com/k3s-io/k3s
A pod never terminated if a container image registry was unavailable
parent
5e159695d9
commit
eeeccd0a67
|
@ -110,7 +110,7 @@ func (puller *imagePuller) PullImage(pod *api.Pod, container *api.Container, pul
|
|||
puller.logIt(ref, api.EventTypeWarning, "Failed", logPrefix, fmt.Sprintf("Failed to pull image %q: %v", container.Image, err), glog.Warning)
|
||||
puller.backOff.Next(backOffKey, puller.backOff.Clock.Now())
|
||||
if err == RegistryUnavailable {
|
||||
msg := fmt.Sprintf("image pull failed for %s because the registry is temporarily unavailable.", container.Image)
|
||||
msg := fmt.Sprintf("image pull failed for %s because the registry is unavailable.", container.Image)
|
||||
return err, msg
|
||||
} else {
|
||||
return ErrImagePull, err.Error()
|
||||
|
|
|
@ -122,7 +122,7 @@ func (puller *serializedImagePuller) PullImage(pod *api.Pod, container *api.Cont
|
|||
puller.logIt(ref, api.EventTypeWarning, FailedToPullImage, logPrefix, fmt.Sprintf("Failed to pull image %q: %v", container.Image, err), glog.Warning)
|
||||
puller.backOff.Next(backOffKey, puller.backOff.Clock.Now())
|
||||
if err == RegistryUnavailable {
|
||||
msg := fmt.Sprintf("image pull failed for %s because the registry is temporarily unavailable.", container.Image)
|
||||
msg := fmt.Sprintf("image pull failed for %s because the registry is unavailable.", container.Image)
|
||||
return err, msg
|
||||
} else {
|
||||
return ErrImagePull, err.Error()
|
||||
|
|
|
@ -3392,7 +3392,8 @@ func (kl *Kubelet) convertStatusToAPIStatus(pod *api.Pod, podStatus *kubecontain
|
|||
} else if reason == kubecontainer.ErrImagePullBackOff ||
|
||||
reason == kubecontainer.ErrImageInspect ||
|
||||
reason == kubecontainer.ErrImagePull ||
|
||||
reason == kubecontainer.ErrImageNeverPull {
|
||||
reason == kubecontainer.ErrImageNeverPull ||
|
||||
reason == kubecontainer.RegistryUnavailable {
|
||||
// mark it as waiting, reason will be filled bellow
|
||||
containerStatus.State = api.ContainerState{Waiting: &api.ContainerStateWaiting{}}
|
||||
} else if reason == kubecontainer.ErrRunContainer {
|
||||
|
|
Loading…
Reference in New Issue