Skip to content

Conversation

joelanford
Copy link
Member

Re-opening here now that poc-boxcutter PR is merged

Original PR: thetechnick#5

Description

A few small fixups and comment additions to help remember follow-ups:

  1. Make Reconcile and reconcile more consistent between CE and CER reconcilers
    • update status in one place in Reconcile
    • only log reconciler start/stop if we actually call reconcile

NOTE: There is still one major difference: CER updates finalizers as separate patches and continues reconcile logic. CE updates finalizers and requires re-reconcile to continue beyond. The CER logic may cause issues where the next reconcile sees a stale resource version (from finalizer patch) because the status update event isn't seen by our informer in time. This ultimately leads to reconciling a stale CER that manifests as a conflict error in our logs that is often a red herring for users trying to troubleshoot issues in controllers.

Another noticeable difference is that CE uses controller-runtime Finalizers helpers, and CER handles things manually.

Changing this broke unit tests, so I decided not to leave that change out to keep the PR scope small. I'll make a separate PR that focuses just on finalizers.

Reviewer Checklist

  • API Go Documentation
  • Tests: Unit Tests (and E2E Tests, if appropriate)
  • Comprehensive Commit Messages
  • Links to related GitHub Issue(s)

Signed-off-by: Joe Lanford <joe.lanford@gmail.com>
@joelanford joelanford requested a review from a team as a code owner September 9, 2025 01:16
Copy link

netlify bot commented Sep 9, 2025

Deploy Preview for olmv1 ready!

Name Link
🔨 Latest commit eaac82d
🔍 Latest deploy log https://app.netlify.com/projects/olmv1/deploys/68bf800d2fbe75000845209d
😎 Deploy Preview https://deploy-preview-2200--olmv1.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@joelanford joelanford changed the title CER: centralize status updates into big-R Reconcile method 🌱 CER: centralize status updates into big-R Reconcile method Sep 9, 2025
Copy link

codecov bot commented Sep 9, 2025

Codecov Report

❌ Patch coverage is 81.25000% with 12 lines in your changes missing coverage. Please review.
✅ Project coverage is 72.09%. Comparing base (68610d0) to head (eaac82d).
⚠️ Report is 10 commits behind head on main.

Files with missing lines Patch % Lines
...controllers/clusterextensionrevision_controller.go 79.66% 10 Missing and 2 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2200      +/-   ##
==========================================
+ Coverage   72.05%   72.09%   +0.03%     
==========================================
  Files          85       85              
  Lines        8332     8372      +40     
==========================================
+ Hits         6004     6036      +32     
- Misses       1926     1932       +6     
- Partials      402      404       +2     
Flag Coverage Δ
e2e 39.17% <7.81%> (-0.29%) ⬇️
experimental-e2e 46.37% <73.43%> (+0.13%) ⬆️
unit 56.61% <53.12%> (-0.05%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Comment on lines +155 to +165
if err := c.removeFinalizer(ctx, rev, clusterExtensionRevisionTeardownFinalizer); err != nil {
meta.SetStatusCondition(&rev.Status.Conditions, metav1.Condition{
Type: "Available",
Status: metav1.ConditionFalse,
Reason: "ReconcileFailure",
Message: err.Error(),
ObservedGeneration: rev.Generation,
})
return ctrl.Result{}, fmt.Errorf("error removing teardown finalizer: %v", err)
}
return ctrl.Result{}, nil
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems semantically wrong to mark a Revision as "Available" == False for any issue with finalizers.

In general I would not report any internal error as a Status Condition.
If we want to show individual errors to users we should publish events on the resource.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Totally agree that this is likely the wrong type for this. I would expect to come back and clean this up prior to GA once there is a formal design on status handling.

In the meantime, I do think it is an important UX concern to tell the user something in a place they are likely to see it.

If they've deleted a CER (or an agent has on their behalf), but the finalizer isn't being removed for some reason, it would be a bad to UX for the CER to just... have no update. It would look like we just aren't reconciling it.

@tmshort
Copy link
Contributor

tmshort commented Sep 11, 2025

/approve

Copy link

openshift-ci bot commented Sep 11, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: tmshort

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

The pull request process is described here

Needs approval from an approver in each of these files:

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

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Sep 11, 2025
@thetechnick
Copy link
Contributor

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Sep 12, 2025
@openshift-merge-bot openshift-merge-bot bot merged commit f512e1e into operator-framework:main Sep 12, 2025
28 of 30 checks passed
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. lgtm Indicates that a PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants