controller: fix FIPS when rendering rendered-machineconfigs
Fix FIPS not being set if its in the first alphanumerical MC.
@@ -65,11 +65,6 @@ func MergeMachineConfigs(configs []*mcfgv1.MachineConfig, osImageURL string) (*m
}
for idx := 1; idx < len(configs); idx++ {
- // if any of the config has FIPS enabled, it'll be set
- if configs[idx].Spec.FIPS {
- fips = true
- }
-
if configs[idx].Spec.Config.Raw != nil {
mergedIgn, err := ParseAndConvertConfig(configs[idx].Spec.Config.Raw)
if err != nil {
@@ -85,7 +80,11 @@ func MergeMachineConfigs(configs []*mcfgv1.MachineConfig, osImageURL string) (*m
// sets the KernelType if specified in any of the MachineConfig
// Setting kerneType to realtime in any of MachineConfig takes priority
+ // also if any of the config has FIPS enabled, it'll be set
for _, cfg := range configs {
+ if cfg.Spec.FIPS {
+ fips = true
+ }
if cfg.Spec.KernelType == KernelTypeRealtime {
kernelType = cfg.Spec.KernelType
break
