Improve registry key parity between clients
* Don't extract hostname part from docker_url since this leads to docker CLI client not recognizing Docker Hub credentials set by docker_login module anymore (looks for the full URL as a key).
This commit is contained in:
parent
988be3458d
commit
98b21ee7f3
1 changed files with 1 additions and 5 deletions
|
@ -84,7 +84,7 @@ Login to a Docker registry without performing any other action. Make sure that t
|
||||||
|
|
||||||
- name: login to private Docker remote registry and force reauthentification
|
- name: login to private Docker remote registry and force reauthentification
|
||||||
docker_login:
|
docker_login:
|
||||||
registry: https://your.private.registry.io/v1/
|
registry: your.private.registry.io
|
||||||
username: yourself
|
username: yourself
|
||||||
password: secrets3
|
password: secrets3
|
||||||
reauth: yes
|
reauth: yes
|
||||||
|
@ -140,10 +140,6 @@ class DockerLoginManager:
|
||||||
if self.reauth:
|
if self.reauth:
|
||||||
self.log.append("Enforcing reauthentification")
|
self.log.append("Enforcing reauthentification")
|
||||||
|
|
||||||
# Extract hostname part from self.registry if url was specified.
|
|
||||||
registry_url = urlparse(self.registry)
|
|
||||||
self.registry = registry_url.netloc or registry_url.path
|
|
||||||
|
|
||||||
# Connect to registry and login if not already logged in or reauth is enforced.
|
# Connect to registry and login if not already logged in or reauth is enforced.
|
||||||
try:
|
try:
|
||||||
self.response = self.client.login(
|
self.response = self.client.login(
|
||||||
|
|
Loading…
Reference in a new issue