mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-25 12:43:23 +00:00
Merge pull request #19025 from aveshagarwal/master-imagepull-messages
Automatic merge from submit-queue Fix parallel image pullers event messages with reasons constants.
This commit is contained in:
commit
8217172cd4
@ -90,7 +90,7 @@ func (puller *imagePuller) PullImage(pod *api.Pod, container *api.Container, pul
|
||||
if !shouldPullImage(container, present) {
|
||||
if present {
|
||||
msg := fmt.Sprintf("Container image %q already present on machine", container.Image)
|
||||
puller.logIt(ref, api.EventTypeNormal, "Pulled", logPrefix, msg, glog.Info)
|
||||
puller.logIt(ref, api.EventTypeNormal, PulledImage, logPrefix, msg, glog.Info)
|
||||
return nil, ""
|
||||
} else {
|
||||
msg := fmt.Sprintf("Container image %q is not present with pull policy of Never", container.Image)
|
||||
@ -105,9 +105,9 @@ func (puller *imagePuller) PullImage(pod *api.Pod, container *api.Container, pul
|
||||
puller.logIt(ref, api.EventTypeNormal, BackOffPullImage, logPrefix, msg, glog.Info)
|
||||
return ErrImagePullBackOff, msg
|
||||
}
|
||||
puller.logIt(ref, api.EventTypeNormal, "Pulling", logPrefix, fmt.Sprintf("pulling image %q", container.Image), glog.Info)
|
||||
puller.logIt(ref, api.EventTypeNormal, PullingImage, logPrefix, fmt.Sprintf("pulling image %q", container.Image), glog.Info)
|
||||
if err := puller.runtime.PullImage(spec, pullSecrets); err != nil {
|
||||
puller.logIt(ref, api.EventTypeWarning, "Failed", logPrefix, fmt.Sprintf("Failed to pull image %q: %v", container.Image, err), glog.Warning)
|
||||
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 unavailable.", container.Image)
|
||||
@ -116,7 +116,7 @@ func (puller *imagePuller) PullImage(pod *api.Pod, container *api.Container, pul
|
||||
return ErrImagePull, err.Error()
|
||||
}
|
||||
}
|
||||
puller.logIt(ref, api.EventTypeNormal, "Pulled", logPrefix, fmt.Sprintf("Successfully pulled image %q", container.Image), glog.Info)
|
||||
puller.logIt(ref, api.EventTypeNormal, PulledImage, logPrefix, fmt.Sprintf("Successfully pulled image %q", container.Image), glog.Info)
|
||||
puller.backOff.DeleteEntry(backOffKey)
|
||||
puller.backOff.GC()
|
||||
return nil, ""
|
||||
|
Loading…
Reference in New Issue
Block a user