Skip to content

Commit

Permalink
manifest: move coreos.no_persist_ip into image functions
Browse files Browse the repository at this point in the history
Not all image types that use ignition want to define the kernel option.
Specifically, the (upcoming) CoreOS images wont want to enable this, so
let's move it into the image function and add it when the ignition
options are added.  It is conditioned on the distro version for now, so
we can't add it to the global image type kernel options.

This change has no effect on any of the current image types / manifests.
  • Loading branch information
achilleas-k committed Nov 27, 2023
1 parent 18ba303 commit 6187df3
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
2 changes: 2 additions & 0 deletions pkg/distro/fedora/images.go
Original file line number Diff line number Diff line change
Expand Up @@ -525,6 +525,7 @@ func iotImage(workload workload.Workload,
img.LockRoot = true

if !common.VersionLessThan(distro.Releasever(), "38") {
img.KernelOptionsAppend = append(img.KernelOptionsAppend, "coreos.no_persist_ip")
switch img.Platform.GetImageFormat() {
case platform.FORMAT_RAW:
img.IgnitionPlatform = "metal"
Expand Down Expand Up @@ -589,6 +590,7 @@ func iotSimplifiedInstallerImage(workload workload.Workload,

if !common.VersionLessThan(t.arch.distro.osVersion, "38") {
rawImg.IgnitionPlatform = "metal"
rawImg.KernelOptionsAppend = append(rawImg.KernelOptionsAppend, "coreos.no_persist_ip")
if bpIgnition := customizations.GetIgnition(); bpIgnition != nil && bpIgnition.FirstBoot != nil && bpIgnition.FirstBoot.ProvisioningURL != "" {
rawImg.KernelOptionsAppend = append(rawImg.KernelOptionsAppend, "ignition.config.url="+bpIgnition.FirstBoot.ProvisioningURL)
}
Expand Down
2 changes: 2 additions & 0 deletions pkg/distro/rhel9/images.go
Original file line number Diff line number Diff line change
Expand Up @@ -422,6 +422,7 @@ func edgeRawImage(workload workload.Workload,

if !common.VersionLessThan(t.arch.distro.osVersion, "9.2") || !t.arch.distro.isRHEL() {
img.IgnitionPlatform = "metal"
img.KernelOptionsAppend = append(img.KernelOptionsAppend, "coreos.no_persist_ip")
if bpIgnition := customizations.GetIgnition(); bpIgnition != nil && bpIgnition.FirstBoot != nil && bpIgnition.FirstBoot.ProvisioningURL != "" {
img.KernelOptionsAppend = append(img.KernelOptionsAppend, "ignition.config.url="+bpIgnition.FirstBoot.ProvisioningURL)
}
Expand Down Expand Up @@ -492,6 +493,7 @@ func edgeSimplifiedInstallerImage(workload workload.Workload,

if !common.VersionLessThan(t.arch.distro.osVersion, "9.2") || !t.arch.distro.isRHEL() {
rawImg.IgnitionPlatform = "metal"
rawImg.KernelOptionsAppend = append(rawImg.KernelOptionsAppend, "coreos.no_persist_ip")
if bpIgnition := customizations.GetIgnition(); bpIgnition != nil && bpIgnition.FirstBoot != nil && bpIgnition.FirstBoot.ProvisioningURL != "" {
rawImg.KernelOptionsAppend = append(rawImg.KernelOptionsAppend, "ignition.config.url="+bpIgnition.FirstBoot.ProvisioningURL)
}
Expand Down
1 change: 0 additions & 1 deletion pkg/manifest/ostree_deployment.go
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,6 @@ func (p *OSTreeDeployment) serialize() osbuild.Pipeline {

if p.IgnitionPlatform != "" {
kernelOpts = append(kernelOpts,
"coreos.no_persist_ip", // users cannot add connections as we don't have a live iso, this prevents connections to bleed into the system from the ign initrd
"ignition.platform.id="+p.IgnitionPlatform,
"$ignition_firstboot",
)
Expand Down

0 comments on commit 6187df3

Please sign in to comment.