From b796a30efaccc1f559cb63b85bccf41f84f21720 Mon Sep 17 00:00:00 2001 From: Steven Powell Date: Thu, 12 Oct 2023 13:55:50 -0700 Subject: [PATCH] test: Fix image path in cached-images --- test/integration/aaa_download_only_test.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/test/integration/aaa_download_only_test.go b/test/integration/aaa_download_only_test.go index a080b5673d1c..797955ce9ea6 100644 --- a/test/integration/aaa_download_only_test.go +++ b/test/integration/aaa_download_only_test.go @@ -122,8 +122,11 @@ func TestDownloadOnly(t *testing.T) { } for _, img := range imgs { + pathToImage := []string{localpath.MiniPath(), "cache", "images", runtime.GOOS} img = strings.Replace(img, ":", "_", 1) // for example kube-scheduler:v1.15.2 --> kube-scheduler_v1.15.2 - fp := filepath.Join(localpath.MiniPath(), "cache", "images", img) + imagePath := strings.Split(img, "/") // changes "gcr.io/k8s-minikube/storage-provisioner_v5" into ["gcr.io", "k8s-minikube", "storage-provisioner_v5"] to match cache folder structure + pathToImage = append(pathToImage, imagePath...) + fp := filepath.Join(pathToImage...) _, err := os.Stat(fp) if err != nil { t.Errorf("expected image file exist at %q but got error: %v", fp, err)