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

attempt to read ~/.docker/config.json for registry auths #262

Merged
merged 5 commits into from
Jun 16, 2022

Conversation

evandam
Copy link
Contributor

@evandam evandam commented Mar 8, 2022

Description

Rough attempt to resolve #261 by reading ~/.docker/config.json to get auths for an image's registry rather than relying on a single creds_file while not breaking any existing compatibility (by introducing a new docker_config_auth flag). I'm sure it's far from perfect, but hoping this is a good jumping off point and folks have better ideas.

I realize image_registry = image.split('/').first will often be misleading especially for official images on DockerHub, but might be good enough.

Looks like there's some similar work in https://github.com/test-kitchen/kitchen-dokken/pull/189/files but not sure 🤷‍♂️

Issues Resolved

Fixes #261

Check List

  • All tests pass. See TESTING.md for details.
  • New functionality includes testing.
  • New functionality has been documented in the README if applicable.

Signed-off-by: Ashique P S <Ashique.saidalavi@progress.com>
…json

Signed-off-by: Ashique P S <Ashique.saidalavi@progress.com>
@ashiqueps ashiqueps merged commit e921c8a into test-kitchen:main Jun 16, 2022
@PJB3005
Copy link
Contributor

PJB3005 commented Jul 7, 2022

This seems to break Kitchen if you don't have a ~/.docker/config.json (file not found error) and then a nil value call if you don't have an auths key in it.

@thenoid
Copy link

thenoid commented Jul 19, 2022

Aye this is breaking for us as well.

@evandam
Copy link
Contributor Author

evandam commented Jul 19, 2022

Hey folks, I opened a new PR that should address this #276

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Cannot pull Chef image when using custom image/creds file
4 participants