-
Notifications
You must be signed in to change notification settings - Fork 169
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
Propagate errors of GenevaLogging controller #3221
Conversation
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 code looks good, but I think we should follow our standard pattern for propoating the controller status conditions by using base.AROController
; it'll save us some duplicate code and make things easier to maintain over time.
pkg/operator/controllers/genevalogging/genevalogging_controller.go
Outdated
Show resolved
Hide resolved
Errors will be handled in the Reconcile method.
3ca89ce
to
44d7535
Compare
I rewrote my changes from scratch since |
The PR linked in the breadcrumb is admittedly not the most up-to-date example of how to do this - that initial PR predates the existence of the base controller and helper functions. Perhaps we should update any future stories to point to a more recent example, such as this PR itself? |
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.
Changes to the controller LGTM, I like the refactor to split the "work" into a simple function and let Reconcile just focus on controller things.
I think we should capture our expected conditions in the tests, similar to other PRs such as #2965.
Added condition checks to the unit tests, although there's currently no test cases that cause an error. |
938d811
to
787c718
Compare
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.
Tests LGTM. The lack of test coverage over error scenarios is concerning, but that can be a follow-up effort.
* genevalogging: Use AROController as base type * genevalogging: Split off business logic for uniform error handling * genevalogging: Add condition for controller status * genevalogging: Check status conditions in unit tests --------- Co-authored-by: Matthew Barnes <[email protected]>
Which issue this PR addresses:
[ARO-2994] Propagate errors of GenevaLogging controller
under epic [ARO-1627] Propagate Errors and Statuses of ARO Controllers to ARO Cluster Operator
What this PR does / why we need it:
Adds a
GenevaLoggingReady
"check" condition to thecluster.aro.openshift.io/v1alpha1
singleton object that exposes controller errors.Test plan for issue:
Manual testing using a custom operator image.
Is there any documentation that needs to be updated for this PR?
None that I'm aware of.