Skip to content

Commit

Permalink
distro/rhel9: don't add the gpg key from tree for RHEL 10 Azure
Browse files Browse the repository at this point in the history
The image config specifies a key in the OS tree that should be imported
during the build, but this isn't yet available on RHEL 10, so let's skip
it for now.
  • Loading branch information
achilleas-k authored and ondrejbudai committed Mar 14, 2024
1 parent f34860a commit 2f18fe6
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 27 deletions.
56 changes: 33 additions & 23 deletions pkg/distro/rhel9/azure.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,25 +30,6 @@ var (
basePartitionTables: defaultBasePartitionTables,
}

// Azure BYOS image type
azureByosImgType = imageType{
name: "vhd",
filename: "disk.vhd",
mimeType: "application/x-vhd",
packageSets: map[string]packageSetFunc{
osPkgsKey: azurePackageSet,
},
defaultImageConfig: defaultAzureByosImageConfig.InheritFrom(defaultAzureImageConfig),
kernelOptions: defaultAzureKernelOptions,
bootable: true,
defaultSize: 4 * common.GibiByte,
image: diskImage,
buildPipelines: []string{"build"},
payloadPipelines: []string{"os", "image", "vpc"},
exports: []string{"vpc"},
basePartitionTables: defaultBasePartitionTables,
}

// Azure RHUI image type
azureRhuiImgType = imageType{
name: "azure-rhui",
Expand All @@ -70,6 +51,27 @@ var (
}
)

// Azure BYOS image type
func azureByosImgType(rd distribution) imageType {
return imageType{
name: "vhd",
filename: "disk.vhd",
mimeType: "application/x-vhd",
packageSets: map[string]packageSetFunc{
osPkgsKey: azurePackageSet,
},
defaultImageConfig: defaultAzureByosImageConfig(rd).InheritFrom(defaultAzureImageConfig),
kernelOptions: defaultAzureKernelOptions,
bootable: true,
defaultSize: 4 * common.GibiByte,
image: diskImage,
buildPipelines: []string{"build"},
payloadPipelines: []string{"os", "image", "vpc"},
exports: []string{"vpc"},
basePartitionTables: defaultBasePartitionTables,
}
}

func azureSapRhuiImgType(rd distribution) imageType {
return imageType{
name: "azure-sap-rhui",
Expand Down Expand Up @@ -574,10 +576,18 @@ var defaultAzureImageConfig = &distro.ImageConfig{
// Diff of the default Image Config compare to the `defaultAzureImageConfig`
// The configuration for non-RHUI images does not touch the RHSM configuration at all.
// https://issues.redhat.com/browse/COMPOSER-2157
var defaultAzureByosImageConfig = &distro.ImageConfig{
GPGKeyFiles: []string{
"/etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release",
},
func defaultAzureByosImageConfig(rd distribution) *distro.ImageConfig {
ic := &distro.ImageConfig{}
// NOTE RHEL 10 content is currently unsigned - remove this when GPG keys get added to the repos
if rd.Releasever() == "9" {
ic = &distro.ImageConfig{
GPGKeyFiles: []string{
"/etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release",
},
}
}
return ic

}

// Diff of the default Image Config compare to the `defaultAzureImageConfig`
Expand Down
8 changes: 4 additions & 4 deletions pkg/distro/rhel9/distro.go
Original file line number Diff line number Diff line change
Expand Up @@ -356,8 +356,8 @@ func newDistro(name string, major, minor int) *distribution {
}

if rd.isRHEL() { // RHEL-only (non-CentOS) image types
x86_64.addImageTypes(azureX64Platform, azureByosImgType)
aarch64.addImageTypes(azureAarch64Platform, azureByosImgType)
x86_64.addImageTypes(azureX64Platform, azureByosImgType(rd))
aarch64.addImageTypes(azureAarch64Platform, azureByosImgType(rd))
} else {
x86_64.addImageTypes(azureX64Platform, azureImgType)
aarch64.addImageTypes(azureAarch64Platform, azureImgType)
Expand Down Expand Up @@ -466,8 +466,8 @@ func newDistro(name string, major, minor int) *distribution {
)

if rd.isRHEL() { // RHEL-only (non-CentOS) image types
x86_64.addImageTypes(azureX64Platform, azureRhuiImgType, azureByosImgType)
aarch64.addImageTypes(azureAarch64Platform, azureRhuiImgType, azureByosImgType)
x86_64.addImageTypes(azureX64Platform, azureRhuiImgType, azureByosImgType(rd))
aarch64.addImageTypes(azureAarch64Platform, azureRhuiImgType, azureByosImgType(rd))

x86_64.addImageTypes(azureX64Platform, azureSapRhuiImgType(rd))

Expand Down

0 comments on commit 2f18fe6

Please sign in to comment.