-
Notifications
You must be signed in to change notification settings - Fork 2k
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
[27.x backport] login: use normalized hostname when storing #5385
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Normalization/converting the registry address to just a hostname happens inside of `command.GetDefaultAuthConfig`. Use this value for the rest of the login flow/storage. Signed-off-by: Laura Brehm <[email protected]> (cherry picked from commit e532eea) Signed-off-by: Paweł Gronowski <[email protected]>
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## 27.x #5385 +/- ##
==========================================
+ Coverage 60.97% 60.99% +0.01%
==========================================
Files 304 304
Lines 21357 21357
==========================================
+ Hits 13023 13026 +3
+ Misses 7404 7402 -2
+ Partials 930 929 -1 |
laurazard
approved these changes
Sep 2, 2024
renovate bot
added a commit
to earthly/dind
that referenced
this pull request
Sep 9, 2024
This PR contains the following updates: | Package | Update | Change | |---|---|---| | [docker/docker](https://redirect.github.com/docker/docker) | patch | `27.2.0` -> `27.2.1` | --- ### Release Notes <details> <summary>docker/docker (docker/docker)</summary> ### [`v27.2.1`](https://redirect.github.com/moby/moby/releases/tag/v27.2.1) [Compare Source](https://redirect.github.com/docker/docker/compare/v27.2.0-rc.1...v27.2.1) #### 27.2.1 For a full list of pull requests and changes in this release, refer to the relevant GitHub milestones: - [docker/cli, 27.2.1 milestone](https://redirect.github.com/docker/cli/issues?q=is%3Aclosed+milestone%3A27.2.1) - [moby/moby, 27.2.1 milestone](https://redirect.github.com/moby/moby/issues?q=is%3Aclosed+milestone%3A27.2.1) ##### Bug fixes and enhancements - containerd image store: Fix non-container images being hidden in the `docker images` output. [moby/moby#48402](https://redirect.github.com/moby/moby/pull/48402) - containerd image store: Improve `docker pull` error message when the image platform doesn't match. [moby/moby#48415](https://redirect.github.com/moby/moby/pull/48415) - CLI: Fix issue causing login to not remove repository names from passed in registry addresses, resulting in credentials being stored under the wrong key. [docker/cli#5385](https://redirect.github.com/docker/cli/pull/5385) - CLI: Fix issue that will sometimes cause the browser-login flow to fail if the CLI process is suspended and then resumed while waiting for the user to authenticate. [docker/cli#5376](https://redirect.github.com/docker/cli/pull/5376) - CLI: `docker login` now returns an error instead of hanging if called non-interactively with `--password` or `--password-stdin` but without `--user`. [docker/cli#5402](https://redirect.github.com/docker/cli/pull/5402) ##### Packaging updates - Update `runc` to [v1.1.14](https://redirect.github.com/opencontainers/runc/releases/tag/v1.1.14), which contains a fix for [CVE-2024-45310](https://redirect.github.com/opencontainers/runc/security/advisories/GHSA-jfvp-7x6p-h2pv). [moby/moby#48426](https://redirect.github.com/moby/moby/pull/48426) - Update Go runtime to 1.22.7. [moby/moby#48433](https://redirect.github.com/moby/moby/pull/48433), [docker/cli#5411](https://redirect.github.com/docker/cli/pull/5411), [docker/docker-ce-packaging#1068](https://redirect.github.com/docker/docker-ce-packaging/pull/1068) </details> --- ### Configuration 📅 **Schedule**: Branch creation - "after 6am on monday" (UTC), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Enabled. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR was generated by [Mend Renovate](https://mend.io/renovate/). View the [repository job log](https://developer.mend.io/github/earthly/dind). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOC41OS4yIiwidXBkYXRlZEluVmVyIjoiMzguNTkuMiIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOlsicmVub3ZhdGUiXX0=--> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
renovate bot
added a commit
to earthly/dind
that referenced
this pull request
Sep 9, 2024
This PR contains the following updates: | Package | Update | Change | |---|---|---| | [docker/docker](https://redirect.github.com/docker/docker) | patch | `27.2.0` -> `27.2.1` | --- ### Release Notes <details> <summary>docker/docker (docker/docker)</summary> ### [`v27.2.1`](https://redirect.github.com/moby/moby/releases/tag/v27.2.1) [Compare Source](https://redirect.github.com/docker/docker/compare/v27.2.0-rc.1...v27.2.1) #### 27.2.1 For a full list of pull requests and changes in this release, refer to the relevant GitHub milestones: - [docker/cli, 27.2.1 milestone](https://redirect.github.com/docker/cli/issues?q=is%3Aclosed+milestone%3A27.2.1) - [moby/moby, 27.2.1 milestone](https://redirect.github.com/moby/moby/issues?q=is%3Aclosed+milestone%3A27.2.1) ##### Bug fixes and enhancements - containerd image store: Fix non-container images being hidden in the `docker image ls` output. [moby/moby#48402](https://redirect.github.com/moby/moby/pull/48402) - containerd image store: Improve `docker pull` error message when the image platform doesn't match. [moby/moby#48415](https://redirect.github.com/moby/moby/pull/48415) - CLI: Fix issue causing `docker login` to not remove repository names from passed in registry addresses, resulting in credentials being stored under the wrong key. [docker/cli#5385](https://redirect.github.com/docker/cli/pull/5385) - CLI: Fix issue that will sometimes cause the browser-login flow to fail if the CLI process is suspended and then resumed while waiting for the user to authenticate. [docker/cli#5376](https://redirect.github.com/docker/cli/pull/5376) - CLI: `docker login` now returns an error instead of hanging if called non-interactively with `--password` or `--password-stdin` but without `--user`. [docker/cli#5402](https://redirect.github.com/docker/cli/pull/5402) ##### Packaging updates - Update `runc` to [v1.1.14](https://redirect.github.com/opencontainers/runc/releases/tag/v1.1.14), which contains a fix for [CVE-2024-45310](https://redirect.github.com/opencontainers/runc/security/advisories/GHSA-jfvp-7x6p-h2pv). [moby/moby#48426](https://redirect.github.com/moby/moby/pull/48426) - Update Go runtime to 1.22.7. [moby/moby#48433](https://redirect.github.com/moby/moby/pull/48433), [docker/cli#5411](https://redirect.github.com/docker/cli/pull/5411), [docker/docker-ce-packaging#1068](https://redirect.github.com/docker/docker-ce-packaging/pull/1068) </details> --- ### Configuration 📅 **Schedule**: Branch creation - "after 6am on monday" (UTC), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Enabled. ♻ **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR was generated by [Mend Renovate](https://mend.io/renovate/). View the [repository job log](https://developer.mend.io/github/earthly/dind). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOC41OS4yIiwidXBkYXRlZEluVmVyIjoiMzguNTkuMiIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOlsicmVub3ZhdGUiXX0=--> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #5382
- What I did
Normalization/converting the registry address to just a hostname happens inside of
command.GetDefaultAuthConfig
. Use this value for the rest of the login flow/storage.- How to verify it
docker login -u [...] registry-1.docker.io
docker login -u [...] registry-1.docker.io/repo/name
cat ~/.docker/config.json
Should only show one entry in
auths
, forregistry-1.docker.com
.- Description for the changelog
- A picture of a cute animal (not mandatory but encouraged)