Skip to content
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

[20.10 backport] config: print deprecation warning when falling back to ~/.dockercfg #3000

Conversation

thaJeztah
Copy link
Member

@thaJeztah thaJeztah commented Mar 8, 2021

Follow-up to #2526
backport of #2666 and #3025

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.

- What I did

- How I did it

- How to verify it

- Description for the changelog

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

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>
(cherry picked from commit b83bc67)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Copy link
Contributor

@silvin-lubecki silvin-lubecki left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

These were added in b83bc67, but
I'm not sure why I added these; they're likely not needed.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 09ddcff)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
@codecov-io
Copy link

Codecov Report

Merging #3000 (4c3b87d) into 20.10 (55c4c88) will increase coverage by 0.01%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##            20.10    #3000      +/-   ##
==========================================
+ Coverage   57.00%   57.02%   +0.01%     
==========================================
  Files         297      297              
  Lines       18673    18679       +6     
==========================================
+ Hits        10645    10651       +6     
  Misses       7163     7163              
  Partials      865      865              

@tiborvass tiborvass merged commit 55b2abb into docker:20.10 Apr 1, 2021
@thaJeztah thaJeztah deleted the 20.10_backport_old_config_deprecation_warning branch April 1, 2021 11:22
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