summaryrefslogtreecommitdiffstats
path: root/roles/openshift_health_checker/openshift_checks/docker_image_availability.py
diff options
context:
space:
mode:
authorScott Dodson <sdodson@redhat.com>2017-10-23 16:44:03 -0400
committerGitHub <noreply@github.com>2017-10-23 16:44:03 -0400
commit5c5aa53c0c9e7c12169f9c7e2565a6166f0baf63 (patch)
treec34deec242e847aeec4470042715e3738aa4ab95 /roles/openshift_health_checker/openshift_checks/docker_image_availability.py
parent9d62027ef74197cfe0dd52ed2ca9bd9b0319a496 (diff)
parent23b37a72ef60e7d7830321ba65c5e98bf9563232 (diff)
downloadopenshift-5c5aa53c0c9e7c12169f9c7e2565a6166f0baf63.tar.gz
openshift-5c5aa53c0c9e7c12169f9c7e2565a6166f0baf63.tar.bz2
openshift-5c5aa53c0c9e7c12169f9c7e2565a6166f0baf63.tar.xz
openshift-5c5aa53c0c9e7c12169f9c7e2565a6166f0baf63.zip
Merge pull request #5781 from mgugino-upstream-stage/fix-reg-auth-templating
Ensure proper variable templating for skopeo auth credentials
Diffstat (limited to 'roles/openshift_health_checker/openshift_checks/docker_image_availability.py')
-rw-r--r--roles/openshift_health_checker/openshift_checks/docker_image_availability.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/roles/openshift_health_checker/openshift_checks/docker_image_availability.py b/roles/openshift_health_checker/openshift_checks/docker_image_availability.py
index 7c8ac78fe..5beb20503 100644
--- a/roles/openshift_health_checker/openshift_checks/docker_image_availability.py
+++ b/roles/openshift_health_checker/openshift_checks/docker_image_availability.py
@@ -61,10 +61,15 @@ class DockerImageAvailability(DockerHostMixin, OpenShiftCheck):
# for the oreg_url registry there may be credentials specified
components = self.get_var("oreg_url", default="").split('/')
self.registries["oreg"] = "" if len(components) < 3 else components[0]
+
+ # Retrieve and template registry credentials, if provided
self.skopeo_command_creds = ""
oreg_auth_user = self.get_var('oreg_auth_user', default='')
oreg_auth_password = self.get_var('oreg_auth_password', default='')
if oreg_auth_user != '' and oreg_auth_password != '':
+ if self._templar is not None:
+ oreg_auth_user = self._templar.template(oreg_auth_user)
+ oreg_auth_password = self._templar.template(oreg_auth_password)
self.skopeo_command_creds = "--creds={}:{}".format(quote(oreg_auth_user), quote(oreg_auth_password))
# record whether we could reach a registry or not (and remember results)