Skip to content

Commit

Permalink
RHEL-9/Azure: RHUI-specific config is now in compose config
Browse files Browse the repository at this point in the history
Remove the RHUI-specific parts of image type configurations from the
image definition, since these are now specified in the compose
configuration.

Signed-off-by: Tomáš Hozza <[email protected]>
  • Loading branch information
thozza committed Sep 17, 2024
1 parent 3e77806 commit 53a8393
Showing 1 changed file with 3 additions and 38 deletions.
41 changes: 3 additions & 38 deletions pkg/distro/rhel/rhel9/azure.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package rhel9
import (
"github.com/osbuild/images/internal/common"
"github.com/osbuild/images/pkg/arch"
"github.com/osbuild/images/pkg/customizations/subscription"
"github.com/osbuild/images/pkg/disk"
"github.com/osbuild/images/pkg/distro"
"github.com/osbuild/images/pkg/distro/rhel"
Expand Down Expand Up @@ -54,7 +53,7 @@ func mkAzureRhuiImgType(rd *rhel.Distribution) *rhel.ImageType {
it.KernelOptions = defaultAzureKernelOptions
it.Bootable = true
it.DefaultSize = 64 * common.GibiByte
it.DefaultImageConfig = defaultAzureRhuiImageConfig.InheritFrom(defaultAzureImageConfig(rd))
it.DefaultImageConfig = defaultAzureImageConfig(rd)
it.BasePartitionTables = azureRhuiBasePartitionTables

return it
Expand All @@ -78,7 +77,7 @@ func mkAzureSapRhuiImgType(rd *rhel.Distribution) *rhel.ImageType {
it.KernelOptions = defaultAzureKernelOptions
it.Bootable = true
it.DefaultSize = 64 * common.GibiByte
it.DefaultImageConfig = defaultAzureRhuiImageConfig.InheritFrom(sapAzureImageConfig(rd))
it.DefaultImageConfig = sapAzureImageConfig(rd)
it.BasePartitionTables = azureRhuiBasePartitionTables

return it
Expand Down Expand Up @@ -577,40 +576,6 @@ func defaultAzureImageConfig(rd *rhel.Distribution) *distro.ImageConfig {
return ic
}

// Diff of the default Image Config compare to the `defaultAzureImageConfig`
var defaultAzureRhuiImageConfig = &distro.ImageConfig{
GPGKeyFiles: []string{
"/etc/pki/rpm-gpg/RPM-GPG-KEY-microsoft-azure-release",
"/etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release",
},
RHSMConfig: map[subscription.RHSMStatus]*subscription.RHSMConfig{
subscription.RHSMConfigNoSubscription: {
DnfPlugins: subscription.SubManDNFPluginsConfig{
SubscriptionManager: subscription.DNFPluginConfig{
Enabled: common.ToPtr(false),
},
},
SubMan: subscription.SubManConfig{
Rhsmcertd: subscription.SubManRHSMCertdConfig{
AutoRegistration: common.ToPtr(true),
},
Rhsm: subscription.SubManRHSMConfig{
ManageRepos: common.ToPtr(false),
},
},
},
subscription.RHSMConfigWithSubscription: {
SubMan: subscription.SubManConfig{
Rhsmcertd: subscription.SubManRHSMCertdConfig{
AutoRegistration: common.ToPtr(true),
},
// do not disable the redhat.repo management if the user
// explicitly request the system to be subscribed
},
},
},
}

func sapAzureImageConfig(rd *rhel.Distribution) *distro.ImageConfig {
return sapImageConfig(rd.OsVersion()).InheritFrom(defaultAzureRhuiImageConfig.InheritFrom(defaultAzureImageConfig(rd)))
return sapImageConfig(rd.OsVersion()).InheritFrom(defaultAzureImageConfig(rd))
}

0 comments on commit 53a8393

Please sign in to comment.