-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
config: print deprecation warning when falling back to ~/.dockercfg #2666
config: print deprecation warning when falling back to ~/.dockercfg #2666
Conversation
1fdba4a
to
b473bfb
Compare
ab21a50
to
b431c0d
Compare
b431c0d
to
9207469
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: maybe change "will be removed" by "support will be removed"? Otherwise it could be interpreted as the config file itself will be removed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Something like this?
_, _ = 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") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes thanks 👍
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
follow-up to #2526
The docker CLI up until v1.7.0 used the
~/.dockercfg
file 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
~/.dockercfg
file.