sync backoff logic

This commit is contained in:
Ron Lai 2016-07-18 10:23:57 -07:00
parent 115ae62084
commit 7500d706ad
2 changed files with 1 additions and 2 deletions

View File

@ -119,7 +119,6 @@ func (puller *parallelImagePuller) pullImage(pod *api.Pod, container *api.Contai
} }
} }
puller.logIt(ref, api.EventTypeNormal, events.PulledImage, logPrefix, fmt.Sprintf("Successfully pulled image %q", container.Image), glog.Info) puller.logIt(ref, api.EventTypeNormal, events.PulledImage, logPrefix, fmt.Sprintf("Successfully pulled image %q", container.Image), glog.Info)
puller.backOff.DeleteEntry(backOffKey)
puller.backOff.GC() puller.backOff.GC()
return nil, "" return nil, ""
} }

View File

@ -103,7 +103,7 @@ func (puller *serializedImagePuller) pullImage(pod *api.Pod, container *api.Cont
} }
} }
backOffKey := fmt.Sprintf("%s_%s", pod.Name, container.Image) backOffKey := fmt.Sprintf("%s_%s", pod.UID, container.Image)
if puller.backOff.IsInBackOffSinceUpdate(backOffKey, puller.backOff.Clock.Now()) { if puller.backOff.IsInBackOffSinceUpdate(backOffKey, puller.backOff.Clock.Now()) {
msg := fmt.Sprintf("Back-off pulling image %q", container.Image) msg := fmt.Sprintf("Back-off pulling image %q", container.Image)
puller.logIt(ref, api.EventTypeNormal, events.BackOffPullImage, logPrefix, msg, glog.Info) puller.logIt(ref, api.EventTypeNormal, events.BackOffPullImage, logPrefix, msg, glog.Info)