未验证 提交 ff8cec19 编写于 作者: M Medya Ghazizadeh 提交者: GitHub

Merge pull request #10423 from priyawadhwa/fix-test-preload

Fix TestPreload on containerd/crio
......@@ -49,9 +49,15 @@ func TestPreload(t *testing.T) {
t.Fatalf("%s failed: %v", rr.Command(), err)
}
// Now, pull the busybox image into the VMs docker daemon
// Now, pull the busybox image into minikube
image := "busybox"
rr, err = Run(t, exec.CommandContext(ctx, Target(), "ssh", "-p", profile, "--", "docker", "pull", image))
var cmd *exec.Cmd
if ContainerRuntime() == "docker" {
cmd = exec.CommandContext(ctx, Target(), "ssh", "-p", profile, "--", "docker", "pull", image)
} else {
cmd = exec.CommandContext(ctx, Target(), "ssh", "-p", profile, "--", "sudo", "crictl", "pull", image)
}
rr, err = Run(t, cmd)
if err != nil {
t.Fatalf("%s failed: %v", rr.Command(), err)
}
......@@ -65,7 +71,12 @@ func TestPreload(t *testing.T) {
if err != nil {
t.Fatalf("%s failed: %v", rr.Command(), err)
}
rr, err = Run(t, exec.CommandContext(ctx, Target(), "ssh", "-p", profile, "--", "docker", "images"))
if ContainerRuntime() == "docker" {
cmd = exec.CommandContext(ctx, Target(), "ssh", "-p", profile, "--", "docker", "images")
} else {
cmd = exec.CommandContext(ctx, Target(), "ssh", "-p", profile, "--", "sudo", "crictl", "image", "ls")
}
rr, err = Run(t, cmd)
if err != nil {
t.Fatalf("%s failed: %v", rr.Command(), err)
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册