podman_image: Use provided credentials when pulling image (#66372)

* Use credentials when pulling from a remote registry
This commit is contained in:
Patrick Easters 2020-01-15 12:47:12 -05:00 committed by Sam Doran
parent 1cb634a3ab
commit d5c5cb5a17
2 changed files with 6 additions and 0 deletions

View file

@ -0,0 +1,2 @@
bugfixes:
- podman_image - honor username and password options when pulling image from a remote registry

View file

@ -489,6 +489,10 @@ class PodmanImageManager(object):
if self.auth_file:
args.extend(['--authfile', self.auth_file])
if self.username and self.password:
cred_string = '{user}:{password}'.format(user=self.username, password=self.password)
args.extend(['--creds', cred_string])
if self.validate_certs:
args.append('--tls-verify')