- root.go: guard against nil writer in newRegistryClient variadic
parameter to prevent panic on explicit nil pass
- push.go (cmd): replace io.Discard with suppressSummaryWriter that
forwards warnings/errors to stderr while silently dropping the
registry client's built-in "Pushed:"/"Digest:" summary lines
- push.go (action): return a clear error when Run() is called on an
OCI remote without WithPushConfig, preventing nil-pointer panic on
p.cfg.RegistryClient dereference
Signed-off-by: Ilya Kislitsyn <kis-ilya-a@yandex.ru>
Signed-off-by: Ilya Kiselev <kis-ilya-a@yandex.ru>
Address Copilot review feedback:
- WriteTable now uses "Pushed:"/"Digest:" labels consistent with the
registry client's built-in output (pkg/registry/client.go:746-747),
so the default --output table experience is familiar to existing users
- Add TestPushOutputFlagCompletion to verify the --output flag is
properly registered and offers json/yaml/table completions
- Document that Pusher.Push and action.Push.Run signature changes are
intentional breaking changes in the Helm v4 major release
Signed-off-by: Ilya Kiselev <kis-ilya-a@yandex.ru>
cmd/push: implement WriteTable to emit ref and digest
The WithPushOptWriter option and the out field on Push were never
wired to any meaningful output path — ChartUploader.Out is not read
by UploadTo() and the registry client manages its own writer.
Remove them to avoid dead API surface.
WriteTable now writes a tab-aligned REF/DIGEST result to the
command's stdout stream. The registry client continues to write
its own progress output to stderr, so there is no duplication.
Signed-off-by: Mentigen <mentigen@mentigen.ru>
Signed-off-by: Ilya Kiselev <kis-ilya-a@yandex.ru>
Add support for --output flag to 'helm push' command for machine-readable
output formats (JSON and YAML). This enables programmatic consumption of push
results and integration with tools like cosign for artifact signing.
Changes:
- Modified Pusher interface to return (*registry.PushResult, error)
- Updated OCIPusher.Push() and push() to return PushResult
- Updated action.Push.Run() to return (*registry.PushResult, error)
- Added output formatting to push command (table/json/yaml)
- Created pushResult struct with Ref and Digest fields
- Implemented pushWriter with WriteTable/WriteJSON/WriteYAML methods
- Updated test fixtures to handle new return signature
The default table format maintains backward compatibility with existing
plain-text output style.
Fixes#11735
Signed-off-by: Ilya Kiselev <kis-ilya-a@yandex.ru>
Signed-off-by: Manuel Alonso Gonzalez <434575+manute@users.noreply.github.com>
Signed-off-by: Manuel Alonso Gonzalez <m.alonso@Manuels-MacBook-Pro.local>