Add dump package from k8s.io/apimachinery#343
Merged
k8s-ci-robot merged 1 commit intokubernetes:masterfrom Feb 10, 2026
Merged
Conversation
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>
Member
Author
Member
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 DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Member
Member
Author
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.
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-spewpackage itself as well.The package provides the same three utility functions for pretty-printing Go objects using spew as was there in kubernetes:
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
What this PR does / why we need it:
Which issue(s) this PR fixes:
Fixes #
Special notes for your reviewer:
Release note: