Skip to content

OCPBUGS-52302: Fix timing of Spec.ConfigVersion.Desired update in MCN#5121

Merged
openshift-merge-bot[bot] merged 1 commit intoopenshift:mainfrom
isabella-janssen:ocpbugs-52302-mcnSpecStatus
Jul 23, 2025
Merged

OCPBUGS-52302: Fix timing of Spec.ConfigVersion.Desired update in MCN#5121
openshift-merge-bot[bot] merged 1 commit intoopenshift:mainfrom
isabella-janssen:ocpbugs-52302-mcnSpecStatus

Conversation

@isabella-janssen
Copy link
Copy Markdown
Member

@isabella-janssen isabella-janssen commented Jun 13, 2025

Closes: OCPBUGS-52302

- What I did
This moves the MCN spec update function, GenerateAndApplyMachineConfigNodeSpec into the node controller's update function so that the desired config version in the MCN is updated when the node annotation is updated.

- How to verify it

  1. Launch a 4.20 cluster with this PR build included.
launch 4.20,openshift/machine-config-operator#5121 aws
  1. Apply a MachineConfig to trigger a node update.
  2. Track how the desired configs are updated in the MCN's spec and status. The desired config value in the spec should update before the UpdatePrepared condition is True and before the desired config version is updated in the status.
    Example grep to see the necessary fields:
oc describe machineconfignode/<node-name> | grep -E "Config Version|UpdatePrepared" -A 2

- Description for the changelog
OCPBUGS-52302: Fix timing of Spec.ConfigVersion.Desired update in MCN

@openshift-ci openshift-ci Bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jun 13, 2025
@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented Jun 13, 2025

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@openshift-merge-robot openshift-merge-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jun 13, 2025
@openshift-ci openshift-ci Bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jun 13, 2025
@isabella-janssen isabella-janssen force-pushed the ocpbugs-52302-mcnSpecStatus branch from 0649233 to 80b33df Compare June 13, 2025 17:38
@openshift-merge-robot openshift-merge-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jun 13, 2025
@isabella-janssen isabella-janssen force-pushed the ocpbugs-52302-mcnSpecStatus branch from 80b33df to 3d9f06f Compare June 13, 2025 19:36
@openshift-merge-robot openshift-merge-robot added needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. and removed needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. labels Jun 13, 2025
@isabella-janssen isabella-janssen changed the title (not ready for review) OCPBUGS-52302 (not ready for review) OCPBUGS-52302: Fix timing of Spec.ConfigVersion.Desired update in MCN Jun 24, 2025
@openshift-ci-robot openshift-ci-robot added jira/severity-moderate Referenced Jira bug's severity is moderate for the branch this PR is targeting. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. labels Jun 24, 2025
@openshift-ci-robot
Copy link
Copy Markdown
Contributor

@isabella-janssen: This pull request references Jira Issue OCPBUGS-52302, which is valid.

3 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target version (4.20.0) matches configured target version for branch (4.20.0)
  • bug is in the state POST, which is one of the valid states (NEW, ASSIGNED, POST)

Requesting review from QA contact:
/cc @sergiordlr

The bug has been updated to refer to the pull request using the external bug tracker.

Details

In response to this:

TODO:

  • test OCL update case (maybe NA due to update OCL being it's own path?)
  • remove todo comments

Closes: OCPBUGS-52302

- What I did
This moves the MCN spec update function, GenerateAndApplyMachineConfigNodeSpec into the node controller's update function so that the desired config version in the MCN is updated when the node annotation is updated.

- How to verify it

  1. Launch a 4.20 cluster with this PR build included.
launch 4.20,openshift/machine-config-operator#5121 aws
  1. Apply a MachineConfig to trigger a node update.
  2. Track how the desired configs are updated in the MCN's spec and status. The desired config value in the spec should update before the UpdatePrepared condition is True and before the desired config version is updated in the status.
    Example grep to see the necessary fields:
oc describe machineconfignode/<node-name> | grep -E "Config Version|UpdatePrepared" -A 2

- Description for the changelog

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@openshift-ci-robot openshift-ci-robot added the jira/valid-bug Indicates that a referenced Jira bug is valid for the branch this PR is targeting. label Jun 24, 2025
@openshift-ci openshift-ci Bot requested a review from sergiordlr June 24, 2025 21:07
@isabella-janssen isabella-janssen changed the title (not ready for review) OCPBUGS-52302: Fix timing of Spec.ConfigVersion.Desired update in MCN (not ready for review) OCPBUGS-52302: Fix timing of Spec.ConfigVersion.Desired update in MCN Jun 24, 2025
@openshift-merge-robot openshift-merge-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jun 25, 2025
@isabella-janssen isabella-janssen force-pushed the ocpbugs-52302-mcnSpecStatus branch from 7123da8 to 30895c5 Compare June 25, 2025 14:10
@openshift-merge-robot openshift-merge-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jun 25, 2025
@isabella-janssen isabella-janssen changed the title (not ready for review) OCPBUGS-52302: Fix timing of Spec.ConfigVersion.Desired update in MCN OCPBUGS-52302: Fix timing of Spec.ConfigVersion.Desired update in MCN Jun 25, 2025
@isabella-janssen isabella-janssen marked this pull request as ready for review June 25, 2025 19:53
@openshift-ci openshift-ci Bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jun 25, 2025
@isabella-janssen
Copy link
Copy Markdown
Member Author

/retest-required

@djoshy
Copy link
Copy Markdown
Contributor

djoshy commented Jun 27, 2025

This would work, but I have a question: would it make sense to have this around where the annotation is actually being set?

if !layered {
lns.SetDesiredStateFromPool(pool)
} else {
lns.SetDesiredStateFromMachineOSConfig(mosc, mosb)
}

If we're working towards a world where MCN becomes our node object for updates, this would help with that.

@isabella-janssen
Copy link
Copy Markdown
Member Author

would it make sense to have this around where the annotation is actually being set? If we're working towards a world where MCN becomes our node object for updates, this would help with that.

@djoshy Yeah, I agree that setting this right when/where we are setting the annotation for the node makes sense from the perspective of supporting the goal of transitioning to a model where the MCN controls the nodes updates as opposed to the node annotations.

I was originally trying to keep the scope of the bug fix minimal to decrease the risk of unintended side effects (the flow you suggest would involve some tweaks to GenerateAndApplyMachineConfigNodeSpec), but given that MCN is a new feature and tweaks to the function wouldn't impact any other existing user functionality, I think that concern isn't so sound.

tldr: change coming soon... ⏰

@isabella-janssen isabella-janssen changed the title OCPBUGS-52302: Fix timing of Spec.ConfigVersion.Desired update in MCN (not ready for review) OCPBUGS-52302: Fix timing of Spec.ConfigVersion.Desired update in MCN Jun 30, 2025
@isabella-janssen isabella-janssen force-pushed the ocpbugs-52302-mcnSpecStatus branch from 2fc6a23 to d05d2f2 Compare July 2, 2025 12:29
@openshift-ci openshift-ci Bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jul 2, 2025
@isabella-janssen
Copy link
Copy Markdown
Member Author

/test unit

1 similar comment
@isabella-janssen
Copy link
Copy Markdown
Member Author

/test unit

@isabella-janssen isabella-janssen marked this pull request as ready for review July 3, 2025 01:11
@openshift-ci openshift-ci Bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jul 3, 2025
@openshift-ci openshift-ci Bot requested a review from dkhater-redhat July 3, 2025 01:11
@isabella-janssen isabella-janssen force-pushed the ocpbugs-52302-mcnSpecStatus branch from ebce6af to 4b3ea82 Compare July 3, 2025 01:13
@isabella-janssen
Copy link
Copy Markdown
Member Author

/retest-required

1 similar comment
@isabella-janssen
Copy link
Copy Markdown
Member Author

/retest-required

@sergiordlr
Copy link
Copy Markdown
Contributor

Verified using IPI on AWS

  1. Apply a MC
  2. Watch the MCN yaml information
  3. Verify that the desired configVersion in the spec is updated before the UpdatePrepared condition is set to True and the status.configVersion.desired value is updated

Check that the spec value is updated before the UpdatePrepared condition

...
spec:
  configVersion:
    desired: rendered-worker-c40b560645fa6f6e0d6e30c5484e98d8
...
  - lastTransitionTime: "2025-07-15T06:47:33Z"
    message: 'Action during update to rendered-worker-0ca2e2a232efa6bcd38a694e80e99125:
      Update Compatible. Post Cfg Actions: [] Drain Required: false'
    reason: UpdatePrepared
    status: "False"
    type: UpdatePrepared
...
  configVersion:
    current: rendered-worker-0ca2e2a232efa6bcd38a694e80e99125
    desired: rendered-worker-0ca2e2a232efa6bcd38a694e80e99125

Check that the status is updated when UpdatePrepared is true

...
spec:
  configVersion:
    desired: rendered-worker-c40b560645fa6f6e0d6e30c5484e98d8
...
  - lastTransitionTime: "2025-07-15T08:04:56Z"
    message: 'Update Compatible. Post Cfg Actions: [] Drain Required: true'
    reason: UpdatePrepared
    status: "True"
    type: UpdatePrepared
...
  configVersion:
    current: rendered-worker-0ca2e2a232efa6bcd38a694e80e99125
    desired: rendered-worker-c40b560645fa6f6e0d6e30c5484e98d8
  1. All MCN e2e test casess passed

/label qe-approved

@openshift-ci openshift-ci Bot added the qe-approved Signifies that QE has signed off on this PR label Jul 15, 2025
@djoshy
Copy link
Copy Markdown
Contributor

djoshy commented Jul 18, 2025

/lgtm

Thanks for the fix-ups!

@openshift-ci openshift-ci Bot added the lgtm Indicates that a PR is ready to be merged. label Jul 18, 2025
@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented Jul 18, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: djoshy, isabella-janssen

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:
  • OWNERS [djoshy,isabella-janssen]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@isabella-janssen
Copy link
Copy Markdown
Member Author

/retest-required

@djoshy
Copy link
Copy Markdown
Contributor

djoshy commented Jul 23, 2025

/tide refresh

/override ci/prow/okd-scos-images

@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented Jul 23, 2025

@djoshy: Overrode contexts on behalf of djoshy: ci/prow/okd-scos-images

Details

In response to this:

/tide refresh

/override ci/prow/okd-scos-images

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@djoshy
Copy link
Copy Markdown
Contributor

djoshy commented Jul 23, 2025

/test all

@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented Jul 23, 2025

@isabella-janssen: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/e2e-azure-ovn-upgrade-out-of-change 4b3ea82 link false /test e2e-azure-ovn-upgrade-out-of-change
ci/prow/e2e-azure-ovn-upgrade 4b3ea82 link false /test e2e-azure-ovn-upgrade
ci/prow/e2e-gcp-op-ocl 4b3ea82 link false /test e2e-gcp-op-ocl
ci/prow/e2e-aws-serial 4b3ea82 link false /test e2e-aws-serial
ci/prow/okd-scos-e2e-aws-ovn 4b3ea82 link false /test okd-scos-e2e-aws-ovn

Full PR test history. Your PR dashboard.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

@openshift-merge-bot openshift-merge-bot Bot merged commit 30e1d23 into openshift:main Jul 23, 2025
17 of 22 checks passed
@openshift-ci-robot
Copy link
Copy Markdown
Contributor

@isabella-janssen: Jira Issue OCPBUGS-52302: All pull requests linked via external trackers have merged:

Jira Issue OCPBUGS-52302 has been moved to the MODIFIED state.

Details

In response to this:

Closes: OCPBUGS-52302

- What I did
This moves the MCN spec update function, GenerateAndApplyMachineConfigNodeSpec into the node controller's update function so that the desired config version in the MCN is updated when the node annotation is updated.

- How to verify it

  1. Launch a 4.20 cluster with this PR build included.
launch 4.20,openshift/machine-config-operator#5121 aws
  1. Apply a MachineConfig to trigger a node update.
  2. Track how the desired configs are updated in the MCN's spec and status. The desired config value in the spec should update before the UpdatePrepared condition is True and before the desired config version is updated in the status.
    Example grep to see the necessary fields:
oc describe machineconfignode/<node-name> | grep -E "Config Version|UpdatePrepared" -A 2

- Description for the changelog
OCPBUGS-52302: Fix timing of Spec.ConfigVersion.Desired update in MCN

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@openshift-bot
Copy link
Copy Markdown
Contributor

[ART PR BUILD NOTIFIER]

Distgit: ose-machine-config-operator
This PR has been included in build ose-machine-config-operator-container-v4.20.0-202507240050.p0.g30e1d23.assembly.stream.el9.
All builds following this will include this PR.

@isabella-janssen isabella-janssen deleted the ocpbugs-52302-mcnSpecStatus branch July 24, 2025 12:45
@isabella-janssen
Copy link
Copy Markdown
Member Author

/cherry-pick release-4.19

@openshift-cherrypick-robot
Copy link
Copy Markdown

@isabella-janssen: #5121 failed to apply on top of branch "release-4.19":

Applying: node controller: set desired config in MCN spec on node annotation update
Using index info to reconstruct a base tree...
M	pkg/controller/drain/drain_controller.go
M	pkg/controller/node/node_controller.go
M	pkg/controller/node/node_controller_test.go
M	pkg/daemon/daemon.go
M	pkg/daemon/drain.go
M	pkg/daemon/pinned_image_set.go
M	pkg/daemon/update.go
M	pkg/daemon/upgrade_monitor_test.go
M	pkg/operator/sync.go
M	pkg/upgrademonitor/upgrade_monitor.go
Falling back to patching base and 3-way merge...
Auto-merging pkg/upgrademonitor/upgrade_monitor.go
CONFLICT (content): Merge conflict in pkg/upgrademonitor/upgrade_monitor.go
Auto-merging pkg/operator/sync.go
CONFLICT (content): Merge conflict in pkg/operator/sync.go
Auto-merging pkg/daemon/upgrade_monitor_test.go
CONFLICT (content): Merge conflict in pkg/daemon/upgrade_monitor_test.go
Auto-merging pkg/daemon/update.go
CONFLICT (content): Merge conflict in pkg/daemon/update.go
Auto-merging pkg/daemon/pinned_image_set.go
CONFLICT (content): Merge conflict in pkg/daemon/pinned_image_set.go
Auto-merging pkg/daemon/drain.go
CONFLICT (content): Merge conflict in pkg/daemon/drain.go
Auto-merging pkg/daemon/daemon.go
CONFLICT (content): Merge conflict in pkg/daemon/daemon.go
Auto-merging pkg/controller/node/node_controller_test.go
Auto-merging pkg/controller/node/node_controller.go
Auto-merging pkg/controller/drain/drain_controller.go
CONFLICT (content): Merge conflict in pkg/controller/drain/drain_controller.go
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
hint: When you have resolved this problem, run "git am --continue".
hint: If you prefer to skip this patch, run "git am --skip" instead.
hint: To restore the original branch and stop patching, run "git am --abort".
hint: Disable this message with "git config advice.mergeConflict false"
Patch failed at 0001 node controller: set desired config in MCN spec on node annotation update

Details

In response to this:

/cherry-pick release-4.19

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@openshift-merge-robot
Copy link
Copy Markdown
Contributor

Fix included in accepted release 4.21.0-0.nightly-2025-10-18-225958

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. jira/severity-moderate Referenced Jira bug's severity is moderate for the branch this PR is targeting. jira/valid-bug Indicates that a referenced Jira bug is valid for the branch this PR is targeting. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. lgtm Indicates that a PR is ready to be merged. qe-approved Signifies that QE has signed off on this PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants