manifest: use osbuild firewall options on os customization
OSCustomizations defined firewall options as blueprint firewall customizations. Changed it to instead be osbuild firewall stage options. This is swapping out one messy thing for another, but at least now we're consistent in our mess.
This commit is contained in:
parent
f0e29ab697
commit
581dde4215
3 changed files with 25 additions and 15 deletions
|
|
@ -63,7 +63,17 @@ func osCustomizations(
|
|||
osc.DefaultTarget = *imageConfig.DefaultTarget
|
||||
}
|
||||
|
||||
osc.Firewall = c.GetFirewall()
|
||||
if fw := c.GetFirewall(); fw != nil {
|
||||
options := osbuild.FirewallStageOptions{
|
||||
Ports: fw.Ports,
|
||||
}
|
||||
|
||||
if fw.Services != nil {
|
||||
options.EnabledServices = fw.Services.Enabled
|
||||
options.DisabledServices = fw.Services.Disabled
|
||||
}
|
||||
osc.Firewall = &options
|
||||
}
|
||||
|
||||
language, keyboard := c.GetPrimaryLocale()
|
||||
if language != nil {
|
||||
|
|
|
|||
|
|
@ -61,7 +61,17 @@ func osCustomizations(
|
|||
osc.DefaultTarget = *imageConfig.DefaultTarget
|
||||
}
|
||||
|
||||
osc.Firewall = c.GetFirewall()
|
||||
if fw := c.GetFirewall(); fw != nil {
|
||||
options := osbuild.FirewallStageOptions{
|
||||
Ports: fw.Ports,
|
||||
}
|
||||
|
||||
if fw.Services != nil {
|
||||
options.EnabledServices = fw.Services.Enabled
|
||||
options.DisabledServices = fw.Services.Disabled
|
||||
}
|
||||
osc.Firewall = &options
|
||||
}
|
||||
|
||||
language, keyboard := c.GetPrimaryLocale()
|
||||
if language != nil {
|
||||
|
|
@ -135,6 +145,7 @@ func osCustomizations(
|
|||
osc.RHSMConfig = imageConfig.RHSMConfig
|
||||
osc.Subscription = options.Subscription
|
||||
osc.WAAgentConfig = imageConfig.WAAgentConfig
|
||||
osc.Firewall = imageConfig.Firewall
|
||||
osc.UdevRules = imageConfig.UdevRules
|
||||
|
||||
return osc
|
||||
|
|
|
|||
|
|
@ -5,7 +5,6 @@ import (
|
|||
"path/filepath"
|
||||
"strings"
|
||||
|
||||
"github.com/osbuild/osbuild-composer/internal/blueprint"
|
||||
"github.com/osbuild/osbuild-composer/internal/common"
|
||||
"github.com/osbuild/osbuild-composer/internal/disk"
|
||||
"github.com/osbuild/osbuild-composer/internal/distro"
|
||||
|
|
@ -61,9 +60,8 @@ type OSCustomizations struct {
|
|||
|
||||
Groups []users.Group
|
||||
Users []users.User
|
||||
// TODO: drop blueprint types from the API
|
||||
Firewall *blueprint.FirewallCustomization
|
||||
// TODO: drop osbuild types from the API
|
||||
Firewall *osbuild.FirewallStageOptions
|
||||
Grub2Config *osbuild.GRUB2Config
|
||||
Sysconfig []*osbuild.SysconfigStageOptions
|
||||
SystemdLogind []*osbuild.SystemdLogindStageOptions
|
||||
|
|
@ -333,16 +331,7 @@ func (p *OS) serialize() osbuild.Pipeline {
|
|||
}
|
||||
|
||||
if p.Firewall != nil {
|
||||
options := osbuild.FirewallStageOptions{
|
||||
Ports: p.Firewall.Ports,
|
||||
}
|
||||
|
||||
if p.Firewall.Services != nil {
|
||||
options.EnabledServices = p.Firewall.Services.Enabled
|
||||
options.DisabledServices = p.Firewall.Services.Disabled
|
||||
}
|
||||
|
||||
pipeline.AddStage(osbuild.NewFirewallStage(&options))
|
||||
pipeline.AddStage(osbuild.NewFirewallStage(p.Firewall))
|
||||
}
|
||||
|
||||
for _, sysconfigConfig := range p.Sysconfig {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue