Skip to content

Commit 7c51ad0

Browse files
committed
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 <[email protected]>
1 parent 020a597 commit 7c51ad0

File tree

2 files changed

+3
-6
lines changed

2 files changed

+3
-6
lines changed

pkg/machine/define/image_format.go

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,6 @@ func (imf ImageFormat) Kind() string {
2424
}
2525

2626
func (imf ImageFormat) KindWithCompression() string {
27-
// Tar uses xz; all others use zstd
28-
if imf == Tar {
29-
return "tar.xz"
30-
}
27+
// All image formats are compressed with zstd
3128
return fmt.Sprintf("%s.zst", imf.Kind())
3229
}

pkg/machine/define/image_format_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,9 @@ func TestImageFormat_KindWithCompression(t *testing.T) {
5959
imf: Raw,
6060
want: "raw.zst",
6161
}, {
62-
name: "tar.xz",
62+
name: "tar.zst",
6363
imf: Tar,
64-
want: "tar.xz",
64+
want: "tar.zst",
6565
},
6666
}
6767
for _, tt := range tests {

0 commit comments

Comments
 (0)