Skip to content

[release-4.18] OCPBUGS-54463: Update desired config in MCN on OCL update #5026

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: release-4.18
Choose a base branch
from
Draft
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
19 changes: 19 additions & 0 deletions pkg/daemon/update.go
Original file line number Diff line number Diff line change
Expand Up @@ -837,6 +837,25 @@ func (dn *Daemon) updateOnClusterBuild(oldConfig, newConfig *mcfgv1.MachineConfi
oldConfigName := oldConfig.GetName()
newConfigName := newConfig.GetName()

// Add the desired config version to the MCN
// get MCP associated with node. Note that in 4.18 and prior only default worker
// & master node roles/MCPs are supported in MCN, thus the hard-coded label checks
// for determining MCP association.
pool := ""
var ok bool
if dn.node != nil {
if _, ok = dn.node.Labels["node-role.kubernetes.io/master"]; ok {
pool = "master"
} else if _, ok = dn.node.Labels["node-role.kubernetes.io/worker"]; ok {
pool = "worker"
}
}
// update the MCN spec
err := upgrademonitor.GenerateAndApplyMachineConfigNodeSpec(dn.featureGatesAccessor, pool, dn.node, dn.mcfgClient)
if err != nil {
return fmt.Errorf("error updating MCN spec for node %s: %w", dn.node.Name, err)
}

oldIgnConfig, err := ctrlcommon.ParseAndConvertConfig(oldConfig.Spec.Config.Raw)
if err != nil {
return fmt.Errorf("parsing old Ignition config failed: %w", err)
Expand Down