Files
podman/pkg/machine/define/image_format.go
Mario Loriedo 7c51ad0ef8 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 <mario.loriedo@gmail.com>
2025-11-04 12:12:10 +01:00

30 lines
406 B
Go

package define
import "fmt"
type ImageFormat int64
const (
Qcow ImageFormat = iota
Vhdx
Tar
Raw
)
func (imf ImageFormat) Kind() string {
switch imf {
case Vhdx:
return "vhdx"
case Tar:
return "tar"
case Raw:
return "raw"
}
return "qcow2"
}
func (imf ImageFormat) KindWithCompression() string {
// All image formats are compressed with zstd
return fmt.Sprintf("%s.zst", imf.Kind())
}