Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Allow docker_login to function with credential helpers. #61207
This is a potential Fix for #55738
I leveraged Store from docker-py/docker ( Also available from docker-pycreds when using docker-py before version 4.0.0. It appears to be installed by along with python-docker and python3-docker on Ubuntu systems at least.) This natively handles interacting with the credential helpers for both login and logout operations.
To reduce the complexity of docker_login itself, moved the operations for updating config file based credentials into a class that implements the parts of Store's API that are needed. This pushes the complexity of dealing with the config_file further back and makes the changed/not changed logic much simpler.
Additionally, I've added a few very crude tests since there were none I could see for this module.
(This is the squashed version. It took a little more effort to get this clean than I was expecting.)
That's going to be difficult to test for every step, I can install the 1.8.0 version and try it, assuming that version will even function with the docker systems I have access to here. What's an appropriate strategy here?
I'll get that added.
docker-py 1.8.0 also works with current docker daemons. At least it still did half a year ago when I tested it the last time :) Most integration tests are written so that they will also run with old docker-py versions (and will skip the parts they can't run if it is too old either for some features or for the whole module).