Skip to content

Add dump package from k8s.io/apimachinery#343

Merged
k8s-ci-robot merged 1 commit intokubernetes:masterfrom
dims:add-dump-package
Feb 10, 2026
Merged

Add dump package from k8s.io/apimachinery#343
k8s-ci-robot merged 1 commit intokubernetes:masterfrom
dims:add-dump-package

Conversation

@dims
Copy link
Member

@dims dims commented Feb 5, 2026

Move the dump package from k8s.io/apimachinery/pkg/util/dump to k8s.io/utils to make it available for use by other projects without requiring the full apimachinery dependency.

Example: https://github.com/kubernetes-sigs/kustomize/blob/6c8c9cc0e882d5d0a7903543216a402d355185b9/kyaml/yaml/fns.go#L854

This will make it easier to ensure k8s code itself does not have direct calls to go-spew package itself as well.

The package provides the same three utility functions for pretty-printing Go objects using spew as was there in kubernetes:

  • Pretty(): multi-line indented output with disabled methods
  • ForHash(): deterministic output suitable for hashing (sorted keys)
  • OneLine(): compact single-line output

code is from:
https://github.com/kubernetes/kubernetes/tree/dc1ec1211e4f54064ba6dafd8aac46ac3d4379b4/staging/src/k8s.io/apimachinery/pkg/util/dump

What type of PR is this?

/kind feature

Uncomment only one /kind <> line, hit enter to put that in a new line, and remove leading whitespaces from that line:

/kind api-change
/kind bug
/kind cleanup
/kind design
/kind documentation
/kind test
/kind failing-test
/kind feature
/kind flake

What this PR does / why we need it:

Which issue(s) this PR fixes:

Fixes #

Special notes for your reviewer:

Release note:

Adding a new dump package with 3 new methods.

Move the dump package from k8s.io/apimachinery/pkg/util/dump to k8s.io/utils
to make it available for use by other projects without requiring the full
apimachinery dependency.

The package provides three utility functions for pretty-printing Go objects
using spew:
- Pretty(): multi-line indented output with disabled methods
- ForHash(): deterministic output suitable for hashing (sorted keys)
- OneLine(): compact single-line output

Signed-off-by: Davanum Srinivas <davanum@gmail.com>
@k8s-ci-robot k8s-ci-robot added kind/feature Categorizes issue or PR as related to a new feature. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Feb 5, 2026
@k8s-ci-robot k8s-ci-robot added approved Indicates a PR has been approved by an approver from all required OWNERS files. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Feb 5, 2026
@dims
Copy link
Member Author

dims commented Feb 5, 2026

/assign @thockin @liggitt

@skitt
Copy link
Member

skitt commented Feb 10, 2026

/hold for review by @thockin and/or @liggitt, feel free to cancel @dims if my review is enough

I’ve checked that this is strictly identical to the files in apimachinery. +1 for making useful packages available without pulling in all the dependency tree…

/lgtm

@k8s-ci-robot k8s-ci-robot added do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. lgtm "Looks good to me", indicates that a PR is ready to be merged. labels Feb 10, 2026
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: dims, skitt

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@liggitt
Copy link
Member

liggitt commented Feb 10, 2026

/hold for review by @thockin and/or @liggitt, feel free to cancel @dims if my review is enough

I don't have a strong opinion either way

@dims
Copy link
Member Author

dims commented Feb 10, 2026

/hold cancel

thanks @liggitt @skitt

@k8s-ci-robot k8s-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Feb 10, 2026
@k8s-ci-robot k8s-ci-robot merged commit b8788ab into kubernetes:master Feb 10, 2026
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/feature Categorizes issue or PR as related to a new feature. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants