Skip to content

CLI: Add quiet support to pull and align with Docker - #41121

Merged
David Bennett (dkbennett) merged 3 commits into
masterfrom
user/dkbennett/pullquiet
Jul 23, 2026
Merged

CLI: Add quiet support to pull and align with Docker#41121
David Bennett (dkbennett) merged 3 commits into
masterfrom
user/dkbennett/pullquiet

Conversation

@dkbennett

Copy link
Copy Markdown
Member

Summary of the Pull Request

Add a --quiet / -q option to wslc pull with output behavior that matches docker pull exactly. In quiet mode, layer/progress output is suppressed and only the final canonical image reference is printed. As part of matching Docker's client-side behavior, wslc pull now also prints Using default tag: latest for name-only references and always prints the fully-qualified canonical reference as the final line.

This is an entirely client-side change (no IDL/service changes); the behavior was verified line-by-line against Docker's cli/command/image/pull.go.

image

PR Checklist

  • Closes: Link to issue #xxx
  • Communication: I've discussed this with core contributors already. If work hasn't been agreed, this work might be rejected
  • Tests: Added/updated if needed and all pass
  • Localization: All end user facing strings can be localized
  • Dev docs: Added/updated if needed
  • Documentation updated: If checked, please file a pull request on our docs repo and link it here: #xxx

Detailed Description of the Pull Request / Additional comments

wslc pull now mirrors the Docker CLI's runPull flow:

  • --quiet / -q — suppresses progress output by passing a null progress callback to ImageService::Pull (the COM IProgressCallback* is already [in, unique]/nullable). Warnings are unaffected because the warning callback is built internally from the Reporter. Help text is "Suppress verbose output", matching Docker.
  • Using default tag: latest — for a name-only reference (no tag or digest), the tag defaults to latest and, unless quiet, the client reports this on stdout before contacting the registry (exactly as Docker does).
  • Canonical reference always printed — the resolved fully-qualified reference is always printed as the final line, in both quiet and non-quiet modes (e.g. docker.io/library/ubuntu:latest). Previously wslc pull did not print this line; this closes a Docker-parity gap.

A new helper, wsl::windows::common::wslutil::GetCanonicalImageReference, mirrors the client-side normalization in github.com/distribution/reference (ParseNormalizedNamed adds the docker.io default domain and library/ prefix; TagNameOnly defaults a name-only reference to :latest) and produces the reference string printed by docker pull, preserving a tag and digest together when both are present.

Example behavior (matches Docker):

  • wslc pull ubuntu:latest -q prints docker.io/library/ubuntu:latest (single line, no progress)
  • wslc pull alpine:latest prints progress on stdout, then docker.io/library/alpine:latest
  • wslc pull ubuntu prints Using default tag: latest first, then progress + canonical reference
  • wslc pull ubuntu:22.04@sha256:... prints docker.io/library/ubuntu:22.04@sha256:... (both tag and digest preserved)

Validation Steps Performed

  • New tests ran and pass
  • Existing pull tests pass
  • Manual verification from deployed local build

Copilot AI review requested due to automatic review settings July 20, 2026 20:46

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR updates the Windows wslc CLI’s pull behavior to match docker pull, adding a quiet mode and standardizing the final output to always be the canonical image reference on success.

Changes:

  • Added --quiet / -q to wslc pull to suppress progress output (Docker parity).
  • Added client-side “Using default tag: latest” output for name-only references (suppressed in quiet mode).
  • Implemented GetCanonicalImageReference() and added unit + e2e coverage for canonicalization and quiet/name-only behavior.

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
test/windows/WSLCTests.cpp Adds unit tests for canonical image reference normalization.
test/windows/wslc/e2e/WSLCE2EPushPullTests.cpp Adds e2e coverage for pull --quiet and name-only default-tag messaging.
test/windows/wslc/CommandLineTestCases.h Extends parser command-line test cases to include pull --quiet / pull -q.
src/windows/wslc/tasks/ImageTasks.cpp Implements quiet progress suppression, default-tag message, and canonical final-line printing in PullImage.
src/windows/wslc/commands/ImagePullCommand.cpp Wires the Quiet argument into the pull command with pull-specific help text.
src/windows/common/wslutil.h Declares GetCanonicalImageReference() helper.
src/windows/common/wslutil.cpp Implements canonical reference formatting logic (Docker-like normalization).
localization/strings/en-US/Resources.resw Adds localized strings for pull quiet help text and default-tag message.

Comment thread src/windows/common/wslutil.cpp
Copilot AI review requested due to automatic review settings July 20, 2026 21:38

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 8 out of 8 changed files in this pull request and generated no new comments.

@dkbennett
David Bennett (dkbennett) marked this pull request as ready for review July 20, 2026 21:46

@OneBlue Blue (OneBlue) left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Change looks good, minor comments

Comment thread src/windows/common/wslutil.cpp
Comment thread src/windows/wslc/tasks/ImageTasks.cpp

@OneBlue Blue (OneBlue) left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Feel free to merge now and resolve the comments in a followup

@dkbennett
David Bennett (dkbennett) merged commit 5f0dae1 into master Jul 23, 2026
12 checks passed
@dkbennett
David Bennett (dkbennett) deleted the user/dkbennett/pullquiet branch July 23, 2026 17:28
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.

3 participants