feat(push): add -o/--output flag (table|json|yaml) to helm push - #32475
Open
jojinkb wants to merge 1 commit into
Open
feat(push): add -o/--output flag (table|json|yaml) to helm push#32475jojinkb wants to merge 1 commit into
jojinkb wants to merge 1 commit into
Conversation
Adds the standard -o/--output flag to 'helm push' so the pushed reference and manifest digest can be consumed programmatically (e.g. to sign the chart with cosign). The push result is plumbed from the OCI registry client to the CLI through a new, purely additive functional option (pusher.WithPushResultHandler / action.WithPushResultHandler), so no public Go SDK signatures change (HIP-0004). The default table output is byte-for-byte identical to the previous behavior; for json/yaml the registry client's human-readable summary is suppressed so stdout contains only the structured result. Closes helm#11735 Signed-off-by: Jojin <jojin.kb@gmail.com>
promptless-for-oss
pushed a commit
to Promptless/oss-contrib-helm-helm-www
that referenced
this pull request
Jul 25, 2026
…havior) Enhance the machine-readable output section for helm push: add the -o short form, a yaml example, a ref/digest field list, and a note on structured-only stdout in json/yaml modes. Relocate the subsection to the end of the push subcommand section. Verified against helm/helm#32475. Signed-off-by: promptless[bot] <promptless[bot]@users.noreply.github.com>
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.
What this PR does / why we need it:
helm pushcurrently only prints a human-readable summary (Pushed: .../Digest: ...), which makes it awkward to consume the pushed reference and manifest digest programmatically — e.g. to immediately sign the chart with cosign. This PR adds the standard-o/--outputflag (table,json,yaml) tohelm push, consistent withhelm install,helm status,helm get metadata, etc.closes #11735
How it works:
The OCI registry client already returns a
*registry.PushResult, butOCIPusherdiscarded it, so the result never reached the CLI. This PR plumbs it through with purely additive functional options, keeping all public Go SDK signatures unchanged per HIP-0004:pkg/pusher: newWithPushResultHandler(func(*registry.PushResult)) Option;OCIPusherinvokes the handler after a successful push.pkg/action: newWithPushResultHandler(...) PushOpton the push action that forwards the handler to the pusher.Push.Run's signature is unchanged.pkg/cmd:helm pushbinds the shared output flag, captures the result via the handler, and renders it with the existingpkg/cli/outputmachinery.Special notes for your reviewer:
table) output is byte-for-byte identical to today: the registry client keeps writing thePushed:/Digest:summary (including the underscore warning) directly, exactly as before.json/yaml, the registry client's writer is set toio.Discardso stdout contains only the structured result (this also means the OCI "underscore in ref" warning is not printed in these modes; the ref itself is part of the structured output).ref+ manifestdigest, mirroring the table summary). More fields fromregistry.PushResult(chart/prov digests, sizes) can be added later without breaking consumers; happy to include them now if preferred.Pusherinterface,uploader.UploadTo, andaction.Push.Runsignatures are deliberately untouched. feat(push): add --output json/yaml/table flag to helm push #32009 implements the same feature by changing those public signatures; this PR takes a non-breaking approach so it can land within v4.TestPushCmdexercises the real push path end-to-end against the in-processrepotestOCI registry (same infrastructure asTestPullCmd), asserting that-o json/-o yamlstdout parses cleanly and that table output is unchanged.If applicable:
docs neededlabel should be applied if so)This change was developed with AI assistance (Claude Code); I have reviewed and tested it.