8000 cli/command: RegistryAuthenticationPrivilegedFunc: fix hints for login by thaJeztah · Pull Request #6135 · docker/cli · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 16, 2025

Conversation

thaJeztah
Copy link
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
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
codecov-commenter commented Jun 16, 2025

Codecov Report

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

Project coverage is 55.04%. Comparing base (f53bb88) to head (e2632c5).

❌ Your patch status has failed because the patch coverage (0.00%) is below the target coverage (50.00%). You can increase the patch coverage or adjust the target coverage.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #6135   +/-   ##
=======================================
  Coverage   55.04%   55.04%           
=======================================
  Files         361      361           
  Lines       30152    30152           
=======================================
  Hits        16596    16596           
  Misses      12598    12598           
  Partials      958      958           
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@thaJeztah thaJeztah requested review from vvoland and Benehiko 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.

3 participants
0