distro: Add azure-sap-rhui image type to RHEL8

This commit is contained in:
Brian C. Lane 2022-10-12 17:26:26 -07:00 committed by Tomáš Hozza
parent a47c239d11
commit 8c07d65fe0
5 changed files with 44 additions and 1 deletions

View file

@ -78,7 +78,8 @@ func (c *ComposerConfigFile) weldrDistrosImageTypeDenyList() map[string][]string
// GetDefaultConfig returns the default configuration of osbuild-composer
// Defaults:
// - 'azure-rhui', 'ec2', 'ec2-ha', 'ec2-sap' image types on 'rhel-85' are not exposed via Weldr API
// - 'azure-rhui', 'azure-sap-rhui', 'ec2', 'ec2-ha', 'ec2-sap' image types on 'rhel-*'
// are not exposed via Weldr API
func GetDefaultConfig() *ComposerConfigFile {
return &ComposerConfigFile{
Koji: KojiAPIConfig{
@ -99,6 +100,7 @@ func GetDefaultConfig() *ComposerConfigFile {
"rhel-*": {
ImageTypeDenyList: []string{
"azure-rhui",
"azure-sap-rhui",
"ec2",
"ec2-ha",
"ec2-sap",

View file

@ -49,6 +49,7 @@ func TestDefaultConfig(t *testing.T) {
"rhel-*": {
[]string{
"azure-rhui",
"azure-sap-rhui",
"ec2",
"ec2-ha",
"ec2-sap",

View file

@ -588,3 +588,32 @@ var azureRhuiImgType = imageType{
exports: []string{"archive"},
basePartitionTables: azureRhuiBasePartitionTables,
}
func SapAzureImageConfig(rd distribution) *distro.ImageConfig {
return SapImageConfig(rd).InheritFrom(defaultAzureImageConfig)
}
func azureSapImgType(rd distribution) imageType {
return imageType{
name: "azure-sap-rhui",
filename: "disk.vhd.xz",
mimeType: "application/xz",
packageSets: map[string]packageSetFunc{
// the ec2 buildroot is required due to the cloud-init stage and dependency on YAML
buildPkgsKey: ec2BuildPackageSet,
osPkgsKey: azureSapPackageSet,
},
packageSetChains: map[string][]string{
osPkgsKey: {osPkgsKey, blueprintPkgsKey},
},
defaultImageConfig: SapAzureImageConfig(rd),
kernelOptions: defaultAzureKernelOptions,
bootable: true,
defaultSize: 64 * common.GibiByte,
pipelines: vhdPipelines(true),
buildPipelines: []string{"build"},
payloadPipelines: []string{"os", "image", "vpc", "archive"},
exports: []string{"archive"},
basePartitionTables: azureRhuiBasePartitionTables,
}
}

View file

@ -1636,6 +1636,7 @@ func newDistro(distroName string) distro.Distro {
// add azure to RHEL distro only
x86_64.addImageTypes(azureRhuiImgType)
x86_64.addImageTypes(azureByosImgType)
x86_64.addImageTypes(azureSapImgType(rd))
// add ec2 image types to RHEL distro only
x86_64.addImageTypes(ec2ImgTypeX86_64, ec2HaImgTypeX86_64)

View file

@ -104,6 +104,14 @@ func TestFilenameFromType(t *testing.T) {
mimeType: "application/xz",
},
},
{
name: "azure-sap-rhui",
args: args{"azure-sap-rhui"},
want: wantResult{
filename: "disk.vhd.xz",
mimeType: "application/xz",
},
},
{
name: "vmdk",
args: args{"vmdk"},
@ -291,6 +299,7 @@ func TestImageType_Name(t *testing.T) {
"openstack",
"vhd",
"azure-rhui",
"azure-sap-rhui",
"vmdk",
"ami",
"ec2",
@ -480,6 +489,7 @@ func TestArchitecture_ListImageTypes(t *testing.T) {
"openstack",
"vhd",
"azure-rhui",
"azure-sap-rhui",
"vmdk",
"ami",
"ec2",