manifest: support RHSM facts in OSCustomizations

Add the RHSM fact to the OSCustomizations and add the stage to the OS
pipeline if the value is set.
This commit is contained in:
Achilleas Koutsou 2022-11-29 14:33:06 +01:00 committed by Tomáš Hozza
parent 4bd2c0cb1d
commit 3cff4d0c1d

View file

@ -95,6 +95,7 @@ type OSCustomizations struct {
WAAgentConfig *osbuild.WAAgentConfStageOptions
UdevRules *osbuild.UdevRulesStageOptions
LeapSecTZ *string
FactAPIType string
Subscription *distro.SubscriptionImageOptions
RHSMConfig map[distro.RHSMSubscriptionStatus]*osbuild.RHSMStageOptions
@ -521,6 +522,14 @@ func (p *OS) serialize() osbuild.Pipeline {
pipeline.AddStage(osbuild.NewOscapRemediationStage(p.OpenSCAPConfig))
}
if p.FactAPIType != "" {
pipeline.AddStage(osbuild.NewRHSMFactsStage(&osbuild.RHSMFactsStageOptions{
Facts: osbuild.RHSMFacts{
ApiType: p.FactAPIType,
},
}))
}
if p.SElinux != "" {
pipeline.AddStage(osbuild.NewSELinuxStage(&osbuild.SELinuxStageOptions{
FileContexts: fmt.Sprintf("etc/selinux/%s/contexts/files/file_contexts", p.SElinux),