Skip to content

cli/command: RegistryAuthenticationPrivilegedFunc: fix hints for login#6135

Merged
thaJeztah merged 1 commit intodocker:masterfrom
thaJeztah:fix_login_message
Jun 16, 2025
Merged

cli/command: RegistryAuthenticationPrivilegedFunc: fix hints for login#6135
thaJeztah merged 1 commit intodocker:masterfrom
thaJeztah:fix_login_message

Conversation

@thaJeztah
Copy link
Copy Markdown
Member

The RegistryAuthenticationPrivilegedFunc has some conditional logic to add additional hints when logging in to the default (Docker Hub) registry. Commit 9f4165c inadvertently passed the wrong variable to PromptUserForCredentials, which caused it to show the additional hints for Docker Hub.

Before this patch, hints were printed for the default (docker hub) registry;

docker pull icr.io/my-ns/my-image:latest

Login prior to pull:
Log in with your Docker ID or email address to push and pull images from Docker Hub. If you don't have a Docker ID, head over to https://hub.docker.com/ to create one.
You can log in with your password or a Personal Access Token (PAT). Using a limited-scope PAT grants better security and is required for organizations using SSO. Learn more at https://docs.docker.com/go/access-tokens/

Username:

With this patch, those hints are omitted;

docker pull icr.io/my-ns/my-image:latest

Login prior to pull:
Username:

- What I did

- How I did it

- How to verify it

- Human readable description for the release notes

Fix a regression where a login prompt on `docker pull` would show Docker Hub-specific hints when logging in on other registries.

- A picture of a cute animal (not mandatory but encouraged)

The RegistryAuthenticationPrivilegedFunc has some conditional logic to
add additional hints when logging in to the default (Docker Hub) registry.
Commit 9f4165c inadvertently passed the
wrong variable to PromptUserForCredentials, which caused it to show the
additional hints for Docker Hub.

Before this patch, hints were printed for the default (docker hub) registry;

    docker pull icr.io/my-ns/my-image:latest

    Login prior to pull:
    Log in with your Docker ID or email address to push and pull images from Docker Hub. If you don't have a Docker ID, head over to https://hub.docker.com/ to create one.
    You can log in with your password or a Personal Access Token (PAT). Using a limited-scope PAT grants better security and is required for organizations using SSO. Learn more at https://docs.docker.com/go/access-tokens/

    Username:

With this patch, those hints are omitted;

    docker pull icr.io/my-ns/my-image:latest

    Login prior to pull:
    Username:

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
@thaJeztah
Copy link
Copy Markdown
Member Author

I want to look at improving these messages overall, as a the "Login prior to pull:" is a bit awkward, and nothing in the output indicates what registry it's prompting for.

@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Jun 16, 2025

Codecov Report

❌ Patch coverage is 0% with 2 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
cli/command/registry.go 0.00% 2 Missing ⚠️

📢 Thoughts on this report? Let us know!

@thaJeztah thaJeztah requested review from Benehiko and vvoland June 16, 2025 11:47
@thaJeztah thaJeztah merged commit dbb5872 into docker:master Jun 16, 2025
113 of 118 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants