Skip to content

Commit

Permalink
manifest/os: simplify conditions in serialize()
Browse files Browse the repository at this point in the history
Co-authored-by: Michael Vogt <[email protected]>
Signed-off-by: Tomáš Hozza <[email protected]>
  • Loading branch information
2 people authored and achilleas-k committed Aug 7, 2024
1 parent 398a443 commit cdcabab
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions pkg/manifest/os.go
Original file line number Diff line number Diff line change
Expand Up @@ -650,16 +650,16 @@ func (p *OS) serialize() osbuild.Pipeline {
p.EnabledServices = append(p.EnabledServices, subscribeServiceFile)
}

if rhsmConfig := p.RHSMConfig; rhsmConfig != nil {
pipeline.AddStage(osbuild.NewRHSMStage(osbuild.NewRHSMStageOptions(rhsmConfig)))
if p.RHSMConfig != nil {
pipeline.AddStage(osbuild.NewRHSMStage(osbuild.NewRHSMStageOptions(p.RHSMConfig)))
}

if waConfig := p.WAAgentConfig; waConfig != nil {
pipeline.AddStage(osbuild.NewWAAgentConfStage(waConfig))
if p.WAAgentConfig != nil {
pipeline.AddStage(osbuild.NewWAAgentConfStage(p.WAAgentConfig))
}

if udevRules := p.UdevRules; udevRules != nil {
pipeline.AddStage(osbuild.NewUdevRulesStage(udevRules))
if p.UdevRules != nil {
pipeline.AddStage(osbuild.NewUdevRulesStage(p.UdevRules))
}

if pt := p.PartitionTable; pt != nil {
Expand Down Expand Up @@ -792,8 +792,8 @@ func (p *OS) serialize() osbuild.Pipeline {
pipeline.AddStage(osbuild.GenShellInitStage(p.ShellInit))
}

if wslConf := p.WSLConfig; wslConf != nil {
pipeline.AddStage(osbuild.NewWSLConfStage(wslConf))
if p.WSLConfig != nil {
pipeline.AddStage(osbuild.NewWSLConfStage(p.WSLConfig))
}

if p.FIPS {
Expand Down

0 comments on commit cdcabab

Please sign in to comment.