Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions butane/config/openshift/v4_23_exp/validate.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,10 @@ func (os OpenShift) Validate(c path.ContextPath) (r report.Report) {
// See: https://github.com/coreos/butane/issues/611
// See: https://github.com/coreos/butane/issues/613
func (conf Config) Validate(c path.ContextPath) (r report.Report) {
if util.IsTrue(conf.BootDevice.Luks.Cex.Enabled) && !slices.Contains(conf.OpenShift.KernelArguments, "rd.luks.key=/etc/luks/cex.key") {
r.AddOnError(c.Append("openshift", "kernel_arguments"), common.ErrMissingKernelArgumentCex)
}
cex := false
if util.IsTrue(conf.BootDevice.Luks.Cex.Enabled) {
cex = true
}
for _, l := range conf.Storage.Luks {
if util.IsTrue(l.Cex.Enabled) && l.Name == "root" {
cex = true
Expand Down
37 changes: 37 additions & 0 deletions butane/config/openshift/v4_23_exp/validate_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,43 @@ func TestValidateConfig(t *testing.T) {
common.ErrMissingKernelArgumentCex,
path.New("yaml", "openshift", "kernel_arguments"),
},
{
// both boot_device CEX and a root storage.luks CEX entry set;
// the missing kernel argument must be reported exactly once
Config{
Config: fcos.Config{
BootDevice: fcos.BootDevice{
Layout: util.StrToPtr("s390x-eckd"),
Luks: fcos.BootDeviceLuks{
Device: util.StrToPtr("/dev/dasda"),
Cex: base.Cex{
Enabled: util.BoolToPtr(true),
},
},
},
Config: base.Config{
Storage: base.Storage{
Luks: []base.Luks{
{
Name: "root",
Label: util.StrToPtr("luks-root"),
Device: util.StrToPtr("/dev/disk/by-label/root"),
Cex: base.Cex{
Enabled: util.BoolToPtr(true),
},
},
},
},
},
},
OpenShift: OpenShift{
// explicitly empty kernel argument list
KernelArguments: []string{},
},
},
common.ErrMissingKernelArgumentCex,
path.New("yaml", "openshift", "kernel_arguments"),
},
}

for i, test := range tests {
Expand Down
2 changes: 2 additions & 0 deletions docs/release-notes.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ nav_order: 9

### Bug fixes

- butane: report the CEX kernel-argument validation error only once when both `boot_device.luks.cex` and a root `storage.luks` CEX entry are enabled ([#2285](https://github.com/coreos/ignition/pull/2285))


## Upcoming Ignition 2.27.0 (unreleased)

Expand Down