-
Notifications
You must be signed in to change notification settings - Fork 187
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
Remove Event error #1217
Remove Event error #1217
Conversation
e8bb733
to
bb6a37f
Compare
Something to think about: controller-runtime v0.15.0 introduced a |
// PatchOperationFailedReason signals a failure in patching a kubernetes API | ||
// object. |
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.
// PatchOperationFailedReason signals a failure in patching a kubernetes API | |
// object. | |
// PatchOperationFailedReason signals a failure in patching a Kubernetes object. |
maybe?
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.
Kubernetes API server
Kubernetes API machinery
I don't see much of a difference or improvement. It's not redundant but more specific. I can change if it really (not "maybe") makes any difference for anyone.
Remove deprecated Event error. Event error was used for scenarios where an error should result in an event/notification. It was introduced as a contextual error along with Stalling and Waiting errors but was later replaced with Generic error which doesn't have any contextual meaning. The Generic error provided error configuration which allowed defining how the error should be handled. This replaced the contextual error handling with error action handlers which behaved on the error configuration of the errors. The Generic error was first introduced to be used in GitRepository reconciler and was used by new reconcilers like the OCIRepository reconcilers. The old reconcilers bucket, helmrepository and helmchart reconcilers were still using the deprecated Event error. This change replaces the Event errors in these reconcilers with a Generic error. It also fixes a bug in the Generic error constructor which configured the error to be logged by default. This resulted in an error to be logged by the result processor and the runtime, double logging. This behavior has been changed to not log explicitly and allow the runtime to log the error. Since the Generic error is based on defining the error handling behavior in the error configuration, a generic error that needs to be ignored (not returned to the runtime), but logged can enable the logging behavior explicitly on the Generic error instance. This is done in GitRepository reconciler for no-op reconciliations where an ignore error is returned. Signed-off-by: Sunny <darkowlzz@protonmail.com>
Introduce a new event reason for patch operation failure and update all the returned errors from serial patcher to be a generic error so that they are handled like any other error with an associated warning event. Signed-off-by: Sunny <darkowlzz@protonmail.com>
bb6a37f
to
5a92e8b
Compare
Remove deprecated Event error. Event error was used for scenarios where an error should result in an event/notification. It was introduced as a contextual error along with Stalling and Waiting errors but was later replaced with Generic error which doesn't have any contextual meaning. The Generic error provided error configuration which allowed defining how the error should be handled. This replaced the contextual error handling with error action handlers which behaved on the error configuration of the errors.
The Generic error was first introduced to be used in GitRepository reconciler and was used by new reconcilers like the OCIRepository reconcilers. The old reconcilers, bucket, helmrepository and helmchart reconcilers, were still using the deprecated Event error. This change replaces the Event errors in these reconcilers with Generic error.
It also fixes a bug in the Generic error constructor which configured the error to be logged by default. This resulted in an error to be logged by the result processor and the runtime, double logging. This behavior has been changed to not log explicitly and allow the runtime to log the error. Since the Generic error is based on defining the error handling behavior in the error configuration, a generic error that needs to be ignored (not returned to the runtime), but logged can enable the logging behavior explicitly on the Generic error instance. This is done in GitRepository reconciler for no-op reconciliations where an ignore error is returned.
The serial patcher errors are also converted to be a Generic error so that they too are handled like other errors with an associated warning event. A new event reason
PatchOperationFailedReason
is introduced for such warning events.Refer #724 for more historic details.