mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-23 11:50:44 +00:00
Merge pull request #3264 from brendandburns/race
Add a lock around the other docker pull.
This commit is contained in:
commit
512e262dc8
@ -905,14 +905,17 @@ func (kl *Kubelet) syncPod(pod *api.BoundPod, dockerContainers dockertools.Docke
|
||||
}
|
||||
if api.IsPullAlways(container.ImagePullPolicy) ||
|
||||
(api.IsPullIfNotPresent(container.ImagePullPolicy) && (!present || latest)) {
|
||||
kl.pullLock.RLock()
|
||||
if err := kl.dockerPuller.Pull(container.Image); err != nil {
|
||||
if ref != nil {
|
||||
|
||||
record.Eventf(ref, "failed", "failed", "Failed to pull image %q", container.Image)
|
||||
}
|
||||
glog.Errorf("Failed to pull image %q: %v; skipping pod %q container %q.", container.Image, err, podFullName, container.Name)
|
||||
kl.pullLock.RUnlock()
|
||||
continue
|
||||
}
|
||||
kl.pullLock.RUnlock()
|
||||
if ref != nil {
|
||||
record.Eventf(ref, "waiting", "pulled", "Successfully pulled image %q", container.Image)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user