Skip to content

save: add --quiet/-q to suppress progress output#5064

Merged
AkihiroSuda merged 1 commit into
containerd:mainfrom
s3onghyun:save-quiet-flag-v2
Jul 14, 2026
Merged

save: add --quiet/-q to suppress progress output#5064
AkihiroSuda merged 1 commit into
containerd:mainfrom
s3onghyun:save-quiet-flag-v2

Conversation

@s3onghyun

Copy link
Copy Markdown
Contributor

Fixes #4958.

Re-opening #5054, which I accidentally closed with a force-push. This is the same single squashed commit (expect.ExitCodeSuccess review suggestion from @sathiraumesh already applied). Thanks @AkihiroSuda.

nerdctl save always writes a progress bar to stderr, which clutters logs when it is used in scripts and CI. This adds a --quiet/-q flag that suppresses the progress output.

The implementation mirrors the existing --quiet flag on nerdctl load: the flag is threaded into ImageSaveOptions.Quiet, and when set, the transfer progress handler writes to io.Discard instead of os.Stderr. The archive itself is written exactly as before; only the progress output is suppressed.

  • cmd/nerdctl/image/image_save.go: register -q, --quiet and pass it into the options
  • pkg/api/types/image_types.go: add Quiet to ImageSaveOptions
  • pkg/cmd/image/save.go: route progress to io.Discard when quiet
  • docs/command-reference.md: document the flag
  • cmd/nerdctl/image/image_save_test.go: add TestSaveQuiet verifying the archive is still produced correctly with --quiet

Manual check: nerdctl save --help now lists -q, --quiet Suppress the progress output.

Signed-off-by: s3onghyun <s3onghyun@users.noreply.github.com>

@AkihiroSuda AkihiroSuda left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks

@AkihiroSuda AkihiroSuda merged commit cb8fa6c into containerd:main Jul 14, 2026
100 of 104 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

nerdctl save --quiet and/or --progress plain

2 participants