Skip to content

Commit 164cad1

Browse files
fix: panic when image pull fails (#152)
1 parent 0a0dcba commit 164cad1

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

internal/cmd/local/k8s/load_images.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,10 @@ func loadImages(ctx context.Context, dockerClient docker.Client, nodes []nodesli
3838
pterm.Debug.Printfln("error pulling image %s", err)
3939
// image pull errors are intentionally dropped because we're in a goroutine,
4040
// and because we don't want to interrupt other image pulls.
41+
} else {
42+
defer r.Close()
43+
io.Copy(io.Discard, r)
4144
}
42-
defer r.Close()
43-
io.Copy(io.Discard, r)
4445
}(img)
4546
}
4647
wg.Wait()

0 commit comments

Comments
 (0)