mirror of
https://github.com/containers/podman.git
synced 2025-11-28 09:09:44 +08:00
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>
30 lines
406 B
Go
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())
|
|
}
|