fix cache reload to take container runtime into account

pull/10230/head
Priya Wadhwa 2021-01-22 15:30:26 -08:00
parent 1fe7615e9e
commit 6eaf2fd9d1
1 changed files with 10 additions and 1 deletions

View File

@ -617,7 +617,16 @@ func validateCacheCmd(ctx context.Context, t *testing.T, profile string) {
t.Run("cache_reload", func(t *testing.T) { // deleting image inside minikube node manually and expecting reload to bring it back
img := "k8s.gcr.io/pause:latest"
// deleting image inside minikube node manually
rr, err := Run(t, exec.CommandContext(ctx, Target(), "-p", profile, "ssh", "sudo", "docker", "rmi", img))
var binary string
switch ContainerRuntime() {
case "docker":
binary = "docker"
case "containerd", "crio":
binary = "crictl"
}
rr, err := Run(t, exec.CommandContext(ctx, Target(), "-p", profile, "ssh", "sudo", binary, "rmi", img))
if err != nil {
t.Errorf("failed to manually delete image %q : %v", rr.Command(), err)