manifest: add support for shell vars in OSCustomizations

ShellVars are added as a nested map of the form
filename->key->value.  A stage is generated and added if any are
defined.
This commit is contained in:
Achilleas Koutsou 2023-02-15 13:49:27 +01:00 committed by Tomáš Hozza
parent 92bbf5fb8b
commit 816d23988c

View file

@ -15,6 +15,7 @@ import (
"github.com/osbuild/osbuild-composer/internal/ostree"
"github.com/osbuild/osbuild-composer/internal/platform"
"github.com/osbuild/osbuild-composer/internal/rpmmd"
"github.com/osbuild/osbuild-composer/internal/shell"
"github.com/osbuild/osbuild-composer/internal/users"
"github.com/osbuild/osbuild-composer/internal/workload"
)
@ -86,6 +87,9 @@ type OSCustomizations struct {
Groups []users.Group
Users []users.User
ShellInit []shell.InitFile
// TODO: drop osbuild types from the API
Firewall *osbuild.FirewallStageOptions
Grub2Config *osbuild.GRUB2Config
@ -645,6 +649,9 @@ func (p *OS) serialize() osbuild.Pipeline {
DefaultTarget: p.DefaultTarget,
}))
}
if len(p.ShellInit) > 0 {
pipeline.AddStage(osbuild.GenShellInitStage(p.ShellInit))
}
if p.SElinux != "" {
pipeline.AddStage(osbuild.NewSELinuxStage(&osbuild.SELinuxStageOptions{