-
Notifications
You must be signed in to change notification settings - Fork 551
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
CSV Finalizer #3148
CSV Finalizer #3148
Conversation
Skipping CI for Draft Pull Request. |
[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 |
Some of my own commentary:
|
|
cmd/olm/manager.go
Outdated
@@ -123,6 +123,19 @@ func Manager(ctx context.Context, debug bool) (ctrl.Manager, error) { | |||
return nil, err | |||
} | |||
|
|||
cleanupCsvReconciler, err := operators.NewCleanupCsvReconciler( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll defer to @joelanford and @awgreene on this - while I understand why using the controller-runtime
approach may be appealing here, it might be premature to move. It's a duplicate in-memory cache of all of these objects, which is a crying shame, and to make the deletion logic robust we'd need to add listers for mutating and validating admission webhooks, which moves us in the wrong direction. Then again, getting this right in the byzantine framework from v0 may be more work than it's worth.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is strongly based on (i.e. copied from) adoption_controller.go
, which already uses controller-runtime
and reconciles CSVs already... BUT is only used when a specific feature flag is enabled. So, my original plan to piggy back on an existing CSV reconciler (there are two already!), was abandoned, and I created a new one. The controller-runtime
seems to be easier to use/manage, especially with finalizers.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I think the ease of coding is certainly on the side of the controller-runtime
approach - my concern is with duplicating the memory footprint of those informers.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Understood; the reconciller in operatorconditiongenerator_controller.go
already reconciles the CSV, so the impact should be minimal. And I could probably move the code into there.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Either one is missing listers for some of these resources and will have the same downside. @joelanford do we care?
@@ -948,98 +913,6 @@ func (a *Operator) EnsureCSVMetric() error { | |||
return nil | |||
} | |||
|
|||
func (a *Operator) syncGCObject(obj interface{}) (syncError error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
note to self: events on these objects by definition cannot be triggers for cleanup, so losing the cross-queueing should in theory not make any difference
Thanks @stevekuznetsov for your comments! |
07dec70
to
057af8c
Compare
pkg/controller/operators/operatorconditiongenerator_controller.go
Outdated
Show resolved
Hide resolved
pkg/controller/operators/operatorconditiongenerator_controller.go
Outdated
Show resolved
Hide resolved
pkg/controller/operators/operatorconditiongenerator_controller.go
Outdated
Show resolved
Hide resolved
Remove old CSV cleanup code Cleanup CRB/CR/MWC/VWC via finalizer. Signed-off-by: Todd Short <[email protected]>
Remove old CSV cleanup code Cleanup CRB/CR/MWC/VWC via finalizer. Signed-off-by: Todd Short <[email protected]>
Fix #3143
Add a finalizer for CSVs for cleanup, rather than the existing method.
Description of the change:
Motivation for the change:
Architectural changes:
Testing remarks:
Reviewer Checklist
/doc
[FLAKE]
are truly flaky and have an issue