Fix log row which caused panic#4193
Closed
marulkan wants to merge 3 commits intoweaveworks:mainfrom
Closed
Conversation
Collaborator
|
@marulkan Please can you provide more details on this fix |
Contributor
|
@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). |
erikgb
reviewed
Jan 3, 2025
| 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) |
Contributor
There was a problem hiding this comment.
Suggested change
| 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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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