Skip to content

Commit 0e072a8

Browse files
authored
Merge pull request kubernetes#85478 from bart0sh/PR0084-e2e_node-inspect-inspect-image-before-pulling
e2e_node: check if image exists locally before pulling
2 parents be9427e + 88478f3 commit 0e072a8

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

test/e2e_node/image_list.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,11 @@ func (dp *dockerPuller) Name() string {
9898
}
9999

100100
func (dp *dockerPuller) Pull(image string) ([]byte, error) {
101-
return exec.Command("docker", "pull", image).CombinedOutput()
101+
// TODO(random-liu): Use docker client to get rid of docker binary dependency.
102+
if exec.Command("docker", "inspect", "--type=image", image).Run() != nil {
103+
return exec.Command("docker", "pull", image).CombinedOutput()
104+
}
105+
return nil, nil
102106
}
103107

104108
type remotePuller struct {

0 commit comments

Comments
 (0)