config: print deprecation warning when falling back to ~/.dockercfg#2666
Merged
silvin-lubecki merged 1 commit intodocker:masterfrom Mar 8, 2021
Merged
Conversation
1fdba4a to
b473bfb
Compare
hc0503
approved these changes
Nov 6, 2020
ab21a50 to
b431c0d
Compare
b431c0d to
9207469
Compare
1 task
Member
Author
silvin-lubecki
approved these changes
Mar 4, 2021
Contributor
silvin-lubecki
left a comment
There was a problem hiding this comment.
LGTM, just small nit on messaging
cli/config/config.go
Outdated
| mutex.RLock() | ||
| defer mutex.RUnlock() | ||
| if printLegacyFileWarning { | ||
| _, _ = fmt.Fprintln(stderr, "WARNING: The legacy ~/.dockercfg configuration file and file-format are deprecated and will be removed in an upcoming release") |
Contributor
There was a problem hiding this comment.
Nit: maybe change "will be removed" by "support will be removed"? Otherwise it could be interpreted as the config file itself will be removed
Member
Author
There was a problem hiding this comment.
Something like this?
Suggested change
| _, _ = fmt.Fprintln(stderr, "WARNING: The legacy ~/.dockercfg configuration file and file-format are deprecated and will be removed in an upcoming release") | |
| _, _ = fmt.Fprintln(stderr, "WARNING: Support for the legacy ~/.dockercfg configuration file and file-format is deprecated and will be removed in an upcoming release") |
Relates to the deprecation, added in 3c0a167 The docker CLI up until v1.7.0 used the `~/.dockercfg` file to store credentials after authenticating to a registry (`docker login`). Docker v1.7.0 replaced this file with a new CLI configuration file, located in `~/.docker/config.json`. When implementing the new configuration file, the old file (and file-format) was kept as a fall-back, to assist existing users with migrating to the new file. Given that the old file format encourages insecure storage of credentials (credentials are stored unencrypted), and that no version of the CLI since Docker v1.7.0 has created this file, the file is marked deprecated, and support for this file will be removed in a future release. This patch adds a deprecation warning, which is printed if the CLI falls back to using the deprecated ~/.dockercfg file. Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
9207469 to
b83bc67
Compare
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
follow-up to #2526
The docker CLI up until v1.7.0 used the
~/.dockercfgfile to store credentialsafter authenticating to a registry (
docker login). Docker v1.7.0 replaced thisfile with a new CLI configuration file, located in
~/.docker/config.json. Whenimplementing the new configuration file, the old file (and file-format) was kept
as a fall-back, to assist existing users with migrating to the new file.
Given that the old file format encourages insecure storage of credentials
(credentials are stored unencrypted), and that no version of the CLI since
Docker v1.7.0 has created this file, the file is marked deprecated, and support
for this file will be removed in a future release.
This patch adds a deprecation warning, which is printed if the CLI falls back
to using the deprecated
~/.dockercfgfile.