-
Notifications
You must be signed in to change notification settings - Fork 15
print out CEL config warnings #962
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
base: main
Are you sure you want to change the base?
Conversation
|
Absolutely spot on. I always intended to have these emitted, it just slipped off the radar. |
| return nil, errors.WithStack(err) | ||
| } | ||
|
|
||
| if conf.Warn() != nil { |
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.
Could we instead make this an additional return on Reify? It's much less likely to be forgotten in the case a refactor and it avoids any issues that may pop up due to internal mutability.
| logger := log.FromContext(ctx).WithName(fmt.Sprintf("ClusterReconciler[%T].clusterConfigFor", *rp)) | ||
| logger.V(log.InfoLevel).Info("warning during configuration processing", warn) | ||
|
|
||
| r.EventRecorder.Eventf(rp, "Warning", redpandav1alpha2.EventSeverityError, warn) |
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.
Updating the logger name isn't particularly useful IMO. It's just more text to scroll right of to get the useful part of the log. we'll be searching the log message to find this line if need be.
Additional args should come inkey, value pairs.
I'd also vote to drop the event emission for now. I do think this is a valuable thing to emit as an event but as is this event will be unintelligible and I'm not familiar enough with the event recording interface to recommend a better direction.
| logger := log.FromContext(ctx).WithName(fmt.Sprintf("ClusterReconciler[%T].clusterConfigFor", *rp)) | |
| logger.V(log.InfoLevel).Info("warning during configuration processing", warn) | |
| r.EventRecorder.Eventf(rp, "Warning", redpandav1alpha2.EventSeverityError, warn) | |
| logger := log.FromContext(ctx) | |
| logger.V(log.InfoLevel).Info("cluster config reification produced warnings", "warnings", warnings) |
|
This will need to be backported to |
|
This PR is stale because it has been open 5 days with no activity. Remove stale label or comment or this will be closed in 5 days. |
|
This PR was closed because it has been stalled for 5 days with no activity. |
|
This PR is stale because it has been open 5 days with no activity. Remove stale label or comment or this will be closed in 5 days. |
|
This PR was closed because it has been stalled for 5 days with no activity. |
|
This PR is stale because it has been open 5 days with no activity. Remove stale label or comment or this will be closed in 5 days. |
|
This PR is stale because it has been open 5 days with no activity. Remove stale label or comment or this will be closed in 5 days. |
|
This PR was closed because it has been stalled for 5 days with no activity. |
|
This PR is stale because it has been open 5 days with no activity. Remove stale label or comment or this will be closed in 5 days. |
This should make the warnings more visible and such cases easier to debug.