internal/distro/rhel9: handle ignition.firstboot for edge
Signed-off-by: Irene Diez <idiez@redhat.com>
This commit is contained in:
parent
2f2ef709cd
commit
428dd169e4
4 changed files with 43 additions and 1 deletions
|
|
@ -8,6 +8,7 @@ import (
|
|||
"github.com/osbuild/osbuild-composer/internal/container"
|
||||
"github.com/osbuild/osbuild-composer/internal/distro"
|
||||
"github.com/osbuild/osbuild-composer/internal/fdo"
|
||||
"github.com/osbuild/osbuild-composer/internal/ignition"
|
||||
"github.com/osbuild/osbuild-composer/internal/image"
|
||||
"github.com/osbuild/osbuild-composer/internal/manifest"
|
||||
"github.com/osbuild/osbuild-composer/internal/osbuild"
|
||||
|
|
@ -411,6 +412,9 @@ func edgeSimplifiedInstallerImage(workload workload.Workload,
|
|||
if bpFDO := customizations.GetFDO(); bpFDO != nil {
|
||||
img.FDO = fdo.FromBP(*bpFDO)
|
||||
}
|
||||
if bpIgnition := customizations.GetIgnition(); bpIgnition != nil && customizations.Ignition.FirstBoot != nil {
|
||||
img.Ignition = ignition.FromBP(*bpIgnition.FirstBoot)
|
||||
}
|
||||
|
||||
d := t.arch.distro
|
||||
img.ISOLabelTempl = d.isolabelTmpl
|
||||
|
|
|
|||
|
|
@ -332,7 +332,7 @@ func (t *imageType) checkOptions(customizations *blueprint.Customizations, optio
|
|||
}
|
||||
|
||||
if t.name == "edge-simplified-installer" {
|
||||
allowed := []string{"InstallationDevice", "FDO"}
|
||||
allowed := []string{"InstallationDevice", "FDO", "Ignition"}
|
||||
if err := customizations.CheckAllowed(allowed...); err != nil {
|
||||
return fmt.Errorf("unsupported blueprint customizations found for boot ISO image type %q: (allowed: %s)", t.name, strings.Join(allowed, ", "))
|
||||
}
|
||||
|
|
@ -359,6 +359,22 @@ func (t *imageType) checkOptions(customizations *blueprint.Customizations, optio
|
|||
return fmt.Errorf("boot ISO image type %q requires specifying one of [FDO.DiunPubKeyHash,FDO.DiunPubKeyInsecure,FDO.DiunPubKeyRootCerts] configuration to install to when using FDO", t.name)
|
||||
}
|
||||
}
|
||||
|
||||
// ignition is optional, we might be using FDO
|
||||
if customizations.Ignition.HasIgnition() {
|
||||
if customizations.GetIgnition().Embedded != nil && customizations.GetIgnition().FirstBoot != nil {
|
||||
return fmt.Errorf("both ignition embedded and firstboot configurations found")
|
||||
}
|
||||
if customizations.GetIgnition().Embedded != nil {
|
||||
possibleErr := customizations.GetIgnition().Embedded.CheckEmbeddedIgnition()
|
||||
if possibleErr != nil {
|
||||
return possibleErr
|
||||
}
|
||||
}
|
||||
if customizations.GetIgnition().FirstBoot != nil && customizations.GetIgnition().FirstBoot.ProvisioningURL == "" {
|
||||
return fmt.Errorf("ignition.firstboot requires a provisioning url")
|
||||
}
|
||||
}
|
||||
} else if t.name == "edge-installer" {
|
||||
allowed := []string{"User", "Group"}
|
||||
if err := customizations.CheckAllowed(allowed...); err != nil {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue