move exec inside func

pull/7813/head
Medya Gh 2020-04-20 17:37:56 -07:00
parent 9eae9e544c
commit 3bd1608954
1 changed files with 3 additions and 4 deletions

View File

@ -100,11 +100,10 @@ func generateTarball(kubernetesVersion, containerRuntime, tarballFilename string
}
for _, img := range imgs {
pull := func() error {
cmd := imagePullCommand(containerRuntime, img)
cmd.Stdout = os.Stdout
cmd.Stderr = os.Stderr
pull := func() error {
if err := cmd.Run(); err != nil {
time.Sleep(time.Second) // to avoid error: : exec: already started
return errors.Wrapf(err, "pulling image %s", img)