Files
podman/pkg/machine/define/image_format.go
Brent Baude a45ba06d02 Refactor key machine objects
In #20538, I was asked to consider refactoring the new OCI pull code
from within the generic machine directory.  This is something I had
tried when originally coding it but it became apparent that a much
larger refactor to prevent circular deps was needed.  Because I did not
want to pollute the initial PR with that refactor, I asked for the PR to
merge first.  This is the refactor that needed to be done.

Signed-off-by: Brent Baude <bbaude@redhat.com>
2023-11-07 08:30:44 -06:00

35 lines
429 B
Go

package define
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 {
switch imf {
case Vhdx:
return "vhdx.zip"
case Tar:
return "tar.xz"
case Raw:
return "raw.gz"
}
return "qcow2.xz"
}