OCPBUGS-94183, OCPBUGS-94184: [release-4.22] Add transient error handling across all three controllers, fix progressing=true - #485
Conversation
All three reconcilers (CloudConfigReconciler, TrustedCABundleReconciler,
CloudOperatorReconciler) now distinguish between transient errors (API
blips) and permanent errors (corrupt config, unsupported platform):
- Transient errors are silently requeued and only set Degraded=True after
a threshold has elapsed (2m for sub-controllers, 2m30s for the main
controller). lastTransientFailureAt is tracked so a stale failure window
is restarted rather than causing immediate degradation when errors resume
after a long gap.
- Permanent errors set Degraded=True immediately and return nil so
controller-runtime does not requeue; existing watches re-trigger
reconciliation when the underlying data changes.
- Infrastructure NotFound returns Available (nil) rather than Degraded,
matching the main controller's existing behaviour.
Reconcile methods use controller-runtime's TerminalError to mark permanent
errors and a shared finalizeReconcile() deferred function (in
reconcile_dispatch.go) that routes to the correct handler and clears the
failure window on every nil-error return path.
Additional improvements:
- Wrap errors with %w to preserve context through the call chain.
- Consolidate failure-tracking fields into a failureWindow struct with
named staleness constants (noStalenessWindow, defaultStalenessWindow).
- Fix race in cloud config sync test by using a separate reconciler
instance for direct Reconcile() calls.
- Fix aggregatedTransientDegradedThreshold mismatch in the main controller
test that prevented the degraded condition from ever being set.
- Add tests for partial-run degraded scenarios in the clusteroperator
and trusted CA bundle controllers.
- Use specific Gomega matchers or provide failure descriptions per project
conventions.
Co-Authored-By: Claude <noreply@anthropic.com>
Signed-off-by: Nolan Brubaker <nolan@nbrubaker.com>
|
Skipping CI for Draft Pull Request. |
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository: openshift/coderabbit/.coderabbit.yaml Review profile: CHILL Plan: Enterprise Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
sync() returned nil on success, so Reconcile always called setStatusAvailable immediately after setStatusProgressing. Change sync to return (bool, error) so Reconcile can skip setStatusAvailable when resources were just updated. Also fix applyResources overwriting the updated flag each iteration — only the last resource's status was returned.
Updates the logic in the clusteroperator_controller to handle progressing more robustly. The previous fix showed a jump from 14 -> 85% in sippy, but was still possible to set progressing=True then immediately unset on next reconcile. This isn't that useful to a cluster admin trying to watch the progress of the rollout / upgrade. This change keeps Progressing=True until we see the deployment/daemonset actually stabilise.
|
@theobarberbany: This pull request references Jira Issue OCPBUGS-94183, which is invalid:
Comment The bug has been updated to refer to the pull request using the external bug tracker. This pull request references Jira Issue OCPBUGS-94184, which is invalid:
Comment The bug has been updated to refer to the pull request using the external bug tracker. 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. |
|
/jira refresh |
|
@theobarberbany: This pull request references Jira Issue OCPBUGS-94183, which is invalid:
Comment This pull request references Jira Issue OCPBUGS-94184, which is valid. 7 validation(s) were run on this bug
Requesting review from QA contact: 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. |
|
/jira refresh |
|
@theobarberbany: This pull request references Jira Issue OCPBUGS-94183, which is valid. The bug has been moved to the POST state. 7 validation(s) were run on this bug
Requesting review from QA contact: This pull request references Jira Issue OCPBUGS-94184, which is valid. 7 validation(s) were run on this bug
Requesting review from QA contact: 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. |
|
@openshift-ci-robot: GitHub didn't allow me to request PR reviews from the following users: sunzhaohua2. Note that only openshift members and repo collaborators can review this PR, and authors cannot review their own PRs. 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 kubernetes-sigs/prow repository. |
|
/pipeline auto |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: nrb The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
/test e2e-aws-ovn-upgrade |
|
@theobarberbany: 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. |
|
/hold |
|
@theobarberbany: This pull request references Jira Issue OCPBUGS-94183. The bug has been updated to no longer refer to the pull request using the external bug tracker. This pull request references Jira Issue OCPBUGS-94184. The bug has been updated to no longer refer to the pull request using the external bug tracker. 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. |
Summary
This depends on #484 to avoid the race that required the revert previously.