Skip to content

Commit

Permalink
test: Fix image path in cached-images
Browse files Browse the repository at this point in the history
  • Loading branch information
spowelljr committed Oct 12, 2023
1 parent 05228e7 commit b796a30
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion test/integration/aaa_download_only_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit b796a30

Please sign in to comment.