From 7c51ad0ef8c421d226fe63de8841943822677917 Mon Sep 17 00:00:00 2001 From: Mario Loriedo Date: Tue, 4 Nov 2025 12:12:04 +0100 Subject: [PATCH] Fix cache misses when pulling WSL machine image Fixes a regression introduced by b2e6d53 that made always failing the match of the WSL image from the registry with the image in the local cache. The result was that the WSL machine image was always pulled from quay.io even if an identical image was in the local cache. Signed-off-by: Mario Loriedo --- pkg/machine/define/image_format.go | 5 +---- pkg/machine/define/image_format_test.go | 4 ++-- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/pkg/machine/define/image_format.go b/pkg/machine/define/image_format.go index 6adbe75c75..ab96da7625 100644 --- a/pkg/machine/define/image_format.go +++ b/pkg/machine/define/image_format.go @@ -24,9 +24,6 @@ func (imf ImageFormat) Kind() string { } func (imf ImageFormat) KindWithCompression() string { - // Tar uses xz; all others use zstd - if imf == Tar { - return "tar.xz" - } + // All image formats are compressed with zstd return fmt.Sprintf("%s.zst", imf.Kind()) } diff --git a/pkg/machine/define/image_format_test.go b/pkg/machine/define/image_format_test.go index 8c07a6bbd7..fe7c80e739 100644 --- a/pkg/machine/define/image_format_test.go +++ b/pkg/machine/define/image_format_test.go @@ -59,9 +59,9 @@ func TestImageFormat_KindWithCompression(t *testing.T) { imf: Raw, want: "raw.zst", }, { - name: "tar.xz", + name: "tar.zst", imf: Tar, - want: "tar.xz", + want: "tar.zst", }, } for _, tt := range tests {