platform: add special GCE platform format

GCE requires an archive with specific (tar) options, so we should have a
platform format defined separately for it.
Add the GCE image types to the x86_64 arch using the new platform
format.
This commit is contained in:
Achilleas Koutsou 2022-11-07 17:52:04 +01:00 committed by Christian Kellner
parent 3fc8fd2cb9
commit 8c361e510d
2 changed files with 15 additions and 1 deletions

View file

@ -293,6 +293,17 @@ func newDistro(name string, major, minor int) distro.Distro {
x86_64.addImageTypes(
rawX86Platform,
mkAMIImgTypeX86_64(rd.osVersion, rd.isRHEL()),
)
gceX86Platform := &platform.X86{
BIOS: true,
UEFIVendor: rd.vendor,
BasePlatform: platform.BasePlatform{
ImageFormat: platform.FORMAT_GCE,
},
}
x86_64.addImageTypes(
gceX86Platform,
gceImgType,
)
@ -443,7 +454,7 @@ func newDistro(name string, major, minor int) distro.Distro {
)
// add GCE RHUI image to RHEL only
x86_64.addImageTypes(rawX86Platform, gceRhuiImgType)
x86_64.addImageTypes(gceX86Platform, gceRhuiImgType)
} else {
x86_64.addImageTypes(azureX64Platform, azureImgType)
}

View file

@ -17,6 +17,7 @@ const (
FORMAT_QCOW2
FORMAT_VMDK
FORMAT_VHD
FORMAT_GCE
)
func (a Arch) String() string {
@ -46,6 +47,8 @@ func (f ImageFormat) String() string {
return "vmdk"
case FORMAT_VHD:
return "vhd"
case FORMAT_GCE:
return "gce"
default:
panic("invalid image format")
}