KObjSlice: nil entry printed as ""
/kind bug
What steps did you take and what happened:
I added a test in https://github.com/kubernetes/kubernetes/pull/125699/files
logger.Info("Some NodeInfo slice", "nodes", klog.KObjSlice([]*NodeInfo{nil, {}, {node: &v1.Node{}}, {node: &v1.Node{ObjectMeta: metav1.ObjectMeta{Name: "worker"}}}}))
*NodeInfo implements klog.KMetadata. The first slice entry is passed to klog.KObj which detects the nil value and turns it into an empty ObjectRef{}. That then gets printed as "" in the array.
What did you expect to happen:
Some kind of indicator that the first entry is nil.
/triage accepted /help
I am leaving it help wanted for now
@dgrisonnet: This request has been marked as needing help from a contributor.
Guidelines
Please ensure that the issue body includes answers to the following questions:
- Why are we solving this issue?
- To address this issue, are there any code changes? If there are code changes, what needs to be done in the code and what places can the assignee treat as reference points?
- Does this issue have zero to low barrier of entry?
- How can the assignee reach out to you for help?
For more details on the requirements of such an issue, please see here and ensure that they are met.
If this request no longer meets these requirements, the label can be removed
by commenting with the /remove-help command.
In response to this:
/triage accepted /help
I am leaving it help wanted for now
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.