-
Notifications
You must be signed in to change notification settings - Fork 158
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
Fix log row which caused panic #4193
base: main
Are you sure you want to change the base?
Conversation
@marulkan Please can you provide more details on this fix |
@casibbald I am pretty sure this PR is fixing a real issue. If you look at the signature of logr Logger function: func (l Logger) Error(err error, msg string, keysAndValues ...any) The last variadic parameter needs to have a pair number arguments (key + value). |
@@ -286,7 +286,7 @@ func getObjectsWithChildren(ctx context.Context, defaultNS string, objects []*un | |||
if !ok { | |||
namespaced, err = apiutil.IsObjectNamespaced(&obj, k8sClient.Scheme(), k8sClient.RESTMapper()) | |||
if err != nil { | |||
logger.Error(err, "failed to determine if %s is namespace scoped", obj.GetObjectKind().GroupVersionKind().Kind) | |||
logger.Error(err, "failed to determine if %s is namespace scoped", "entry", obj) |
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.
logger.Error(err, "failed to determine if %s is namespace scoped", "entry", obj) | |
logger.Error(err, "failed to determine if object is namespace scoped", "kind", obj.GetObjectKind().GroupVersionKind().Kind) |
To avoid logging the full 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.
@marulkan Do you want to fix/rebase/squash this PR, or should I just do it? Please let me know!
Closes
What changed?
Log line which cause panic
Why was this change made?
Bugfix
How was this change implemented?
How did you validate the change?
Implemented change in cluster where we had a helmchart which triggered this panic (old PSP cr).
Release notes
Documentation Changes