mirror of https://github.com/k3s-io/k3s
Merge pull request #26825 from timstclair/node-e2e-pull
Automatic merge from submit-queue Fix node e2e image pulling retry logicpull/6/head
commit
a2d79d0ef6
|
@ -63,11 +63,15 @@ func PrePullAllImages() error {
|
||||||
err error
|
err error
|
||||||
output []byte
|
output []byte
|
||||||
)
|
)
|
||||||
for i := maxImagePullRetries; i > 0; i++ {
|
for i := 0; i < maxImagePullRetries; i++ {
|
||||||
|
if i > 0 {
|
||||||
|
time.Sleep(imagePullRetryDelay)
|
||||||
|
}
|
||||||
if output, err = exec.Command("docker", "pull", image).CombinedOutput(); err == nil {
|
if output, err = exec.Command("docker", "pull", image).CombinedOutput(); err == nil {
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
time.Sleep(imagePullRetryDelay)
|
glog.Warningf("Failed to pull %s, retrying in %s (%d of %d): %v",
|
||||||
|
image, imagePullRetryDelay.String(), i+1, maxImagePullRetries, err)
|
||||||
}
|
}
|
||||||
if err != nil {
|
if err != nil {
|
||||||
glog.Warningf("Could not pre-pull image %s %v output: %s", image, err, output)
|
glog.Warningf("Could not pre-pull image %s %v output: %s", image, err, output)
|
||||||
|
|
Loading…
Reference in New Issue