Repository navigation
CNTRLPLANE-3691: Decouple NodePool condition handling from CAPI reconciliation - #9875
redhat-chai-bot wants to merge 1 commit into
Conversation
|
@redhat-chai-bot: This pull request references CNTRLPLANE-3691 which is a valid jira issue. Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the task to target the "5.1.0" version, but no target version was set. DetailsIn response to this:
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. |
|
Pipeline controller notification This PR uses the pipeline controller for second-stage tests. Selection and triggering follow the repository configuration. Use |
|
No actionable comments were generated in the recent review.
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #9875 +/- ##
==========================================
+ Coverage 52.31% 52.43% +0.11%
==========================================
Files 826 826
Lines 105380 105368 -12
==========================================
+ Hits 55130 55249 +119
+ Misses 46728 46606 -122
+ Partials 3522 3513 -9
... and 4 files with indirect coverage changes
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
| reason = c.Reason | ||
| if condition.Reason != "" { | ||
| reason = condition.Reason | ||
| } |
There was a problem hiding this comment.
Could you extract the MachinesReadyCondition to NodePoolReadyCondition conversion into one unexported helper and use it from both reconcileMachineDeploymentStatus and reconcileMachineSet? Both paths currently repeat the status/message mapping, empty-reason fallback to AsExpectedReason, and observed-generation assignment. A shared helper would keep those semantics aligned while preserving the current behavior, including returning no condition when MachinesReadyCondition is absent.
This is a nonblocking cleanup suggestion; the duplication predates this PR.
There was a problem hiding this comment.
Addressed in b4df383. Extracted the unexported nodePoolReadyConditions helper and used it from both reconcileMachineDeploymentStatus and reconcileMachineSet. It preserves the absent-condition nil return, status/message mapping, empty-reason fallback to AsExpectedReason, and NodePool observed generation, while leaving transition-time handling with the caller.
Added focused conversion tests and callsite coverage, including repeated MachineSet reconciliation and absent readiness. Full make pre-commit and recursive race-enabled NodePool tests pass on the pushed revision. Final-revision CI and live cloud E2E results remain unverified.
AI-generated. Review for accuracy.
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
Addressed the test-name and assertion-diagnostic feedback in #9875 (comment).
Published revision: b4df383. Complete AI-generated. Review for accuracy. |
Return reconcile-local condition results from CAPI so resource reconciliation no longer mutates NodePool conditions directly. Apply accumulated results in the NodePool controller before error handling. Preserve condition order and status updates across early returns and failures. Assisted-by: LLM Signed-off-by: Chai Bot <chai-bot@redhat.com>
b4df383 to
1efae11
Compare
|
@redhat-chai-bot: all tests passed! Full PR test history. Your PR dashboard. DetailsInstructions 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. |
| r.reachedIgnitionEndpointCondition, | ||
| r.machineAndNodeConditions, | ||
| r.validPlatformConfigCondition, | ||
| // TODO(alberto): consider moving here: |
There was a problem hiding this comment.
This removes only the TODO comment, not either condition. The cleanup accompanied moving condition application into the NodePool controller: CAPI still computes NodePoolUpdatingPlatformMachineTemplateConditionType and NodePoolAutorepairEnabledConditionType, returns them, and the controller applies them immediately after capi.Reconcile, before handling its error.
However, the TODO specifically suggested moving them into this signalConditions list. This PR does not do that; it preserves their later reconciliation order. Removing the comment therefore overstates how much of that TODO is addressed. The location-specific TODO can remain for a separate reorganization.
AI-generated. Review for accuracy.
There was a problem hiding this comment.
Ok so are you putting the todo comment back?
bryan-cox
left a comment
There was a problem hiding this comment.
The spec review found a readiness rollback regression on failed workload writes. The standards review found an unrelated test addition. Both findings are inline.
Validation: focused NodePool tests and the added linter test passed with race detection. A controller-level regression check passed on base 364a78f and failed on this head. Live E2E tests were not run. The spec review used this PR and #9032 because Jira was inaccessible.
| } | ||
| } | ||
|
|
||
| func TestAllowlistOSImageStreamUpgradeScopes(t *testing.T) { |
There was a problem hiding this comment.
[P3][Standards] Move the unrelated OSImageStream test to a separate PR.
TestAllowlistOSImageStreamUpgradeScopes has no dependency on CAPI condition collection or application. CONTRIBUTING.md, under "Prior to Submitting a Pull Request", requires contributors to "Scope commits to one thing" and "save additional improvements for separate PRs." Please separate this test so the controller refactor does not also include unrelated linter-test maintenance.
| return fmt.Errorf("failed to reconcile MachineDeployment %q: %w", | ||
| return reconcileErr | ||
| }) | ||
| result.Conditions = append(result.Conditions, conditions...) |
There was a problem hiding this comment.
[P2][Spec] Preserve the Ready rollback when workload persistence fails.
reconcileWorkload restores the previous NodePool snapshot when CreateOrPatch fails. Previously, that also rolled back the Ready update computed inside the mutation. This append returns that condition despite the rollback, and the controller then persists it through its error path. The MachineSet branch at line 155 has the same issue.
I reproduced this through the outer NodePool reconciler by requesting five replicas from an existing three-replica MachineDeployment and injecting a workload patch failure. The stored MachineDeployment still requested three replicas, but this revision persisted Ready=True with ObservedGeneration=17. The same regression check passed on the base revision, which preserved the previous readiness state.
This contradicts #9032's promise that "the same conditions are set under the same circumstances" and this PR's requirement to preserve conditions across later errors. Please append workload conditions only after reconcileWorkload succeeds. Conditions computed before that operation should still survive its failure, and successful workload conditions should still survive later MHC errors. Update the new failure tests, which currently assert the changed behavior.
Summary
Tests
Live E2E execution and final-revision CI results remain to be verified on this PR.
AI-generated. Review for accuracy.
@bryan-cox requested from Slack
Summary by CodeRabbit