diff --git a/cmd/osbuild-composer/config.go b/cmd/osbuild-composer/config.go index 5770e698d..4da91ab66 100644 --- a/cmd/osbuild-composer/config.go +++ b/cmd/osbuild-composer/config.go @@ -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", diff --git a/cmd/osbuild-composer/config_test.go b/cmd/osbuild-composer/config_test.go index 2cb30379e..27698a7b4 100644 --- a/cmd/osbuild-composer/config_test.go +++ b/cmd/osbuild-composer/config_test.go @@ -49,6 +49,7 @@ func TestDefaultConfig(t *testing.T) { "rhel-*": { []string{ "azure-rhui", + "azure-sap-rhui", "ec2", "ec2-ha", "ec2-sap", diff --git a/internal/distro/rhel8/azure.go b/internal/distro/rhel8/azure.go index dc21556e7..010fdace2 100644 --- a/internal/distro/rhel8/azure.go +++ b/internal/distro/rhel8/azure.go @@ -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, + } +} diff --git a/internal/distro/rhel8/distro.go b/internal/distro/rhel8/distro.go index c88b0aeb3..5c6ef191c 100644 --- a/internal/distro/rhel8/distro.go +++ b/internal/distro/rhel8/distro.go @@ -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) diff --git a/internal/distro/rhel8/distro_test.go b/internal/distro/rhel8/distro_test.go index 645adb311..d24a386c0 100644 --- a/internal/distro/rhel8/distro_test.go +++ b/internal/distro/rhel8/distro_test.go @@ -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",