Skip to content
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

text output: formatting of slice of pointers #352

Closed
pohly opened this issue Sep 19, 2022 · 7 comments
Closed

text output: formatting of slice of pointers #352

pohly opened this issue Sep 19, 2022 · 7 comments
Labels
kind/feature Categorizes issue or PR as related to a new feature. triage/accepted Indicates an issue or PR is ready to be actively worked on.

Comments

@pohly
Copy link

pohly commented Sep 19, 2022

/kind feature

Describe the solution you'd like

When the value in a key/value pair is a slice like []*v1.Pod, klog currently formats the slice with the fallback fmt.Sprintf("%+v", ...) which then results in a list of pointer values ([0xc000dce900]) which is often not useful. I would find it more useful to get a dump of the objects that are pointed to.

There are probably other cases like this, but list of objects is the one I have seen myself a few times.

@k8s-ci-robot k8s-ci-robot added the kind/feature Categorizes issue or PR as related to a new feature. label Sep 19, 2022
@pohly
Copy link
Author

pohly commented Sep 19, 2022

@serathius : what do you think?

@pohly
Copy link
Author

pohly commented Sep 19, 2022

For backward compatibility we probably would have to print the pointer in addition to the object, because some users might expect that.

@k8s-triage-robot
Copy link

The Kubernetes project currently lacks enough contributors to adequately respond to all issues and PRs.

This bot triages issues and PRs according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Mark this issue or PR as fresh with /remove-lifecycle stale
  • Mark this issue or PR as rotten with /lifecycle rotten
  • Close this issue or PR with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle stale

@k8s-ci-robot k8s-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Dec 18, 2022
@pohly
Copy link
Author

pohly commented Dec 19, 2022

/remove-lifecycle stale
/triage accepted

@serathius: what do you think about this? Would this be useful enough to justify some extra complexity?

@k8s-ci-robot k8s-ci-robot added triage/accepted Indicates an issue or PR is ready to be actively worked on. and removed lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. labels Dec 19, 2022
@pohly
Copy link
Author

pohly commented Apr 26, 2023

#352 solves most of this. Falling back to JSON for a slice means that we don't support fmt.Stringer and logr.Marshaler implementations for the values inside the slices, but that is consistent with other go-logr backends.

@pohly
Copy link
Author

pohly commented May 9, 2023

#352 was merged, therefore I consider this issue resolved.

/close

@k8s-ci-robot
Copy link

@pohly: Closing this issue.

In response to this:

#352 was merged, therefore I consider this issue resolved.

/close

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/test-infra repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature Categorizes issue or PR as related to a new feature. triage/accepted Indicates an issue or PR is ready to be actively worked on.
Projects
None yet
Development

No branches or pull requests

3 participants