summaryrefslogtreecommitdiffstats
path: root/roles/openshift_cli/templates
diff options
context:
space:
mode:
authorBrenton Leanhardt <bleanhar@redhat.com>2016-02-17 13:05:12 -0500
committerBrenton Leanhardt <bleanhar@redhat.com>2016-03-03 09:05:42 -0500
commit50b9eefd2b6266b29755e37090138096a2aebc31 (patch)
tree5bb7d786e2a8d1c1d7144004ed60b6cb9c256a2a /roles/openshift_cli/templates
parenta8edeaea8e8c67f5f930b54ccda5b575340231f5 (diff)
downloadopenshift-50b9eefd2b6266b29755e37090138096a2aebc31.tar.gz
openshift-50b9eefd2b6266b29755e37090138096a2aebc31.tar.bz2
openshift-50b9eefd2b6266b29755e37090138096a2aebc31.tar.xz
openshift-50b9eefd2b6266b29755e37090138096a2aebc31.zip
First past at the upgrade process
Diffstat (limited to 'roles/openshift_cli/templates')
-rw-r--r--roles/openshift_cli/templates/openshift.j211
1 files changed, 10 insertions, 1 deletions
diff --git a/roles/openshift_cli/templates/openshift.j2 b/roles/openshift_cli/templates/openshift.j2
index a7c148a22..d2a3f066c 100644
--- a/roles/openshift_cli/templates/openshift.j2
+++ b/roles/openshift_cli/templates/openshift.j2
@@ -20,4 +20,13 @@ See https://docs.openshift.org/latest/cli_reference/get_started_cli.html
=================================================================================
"""
-docker run -i --privileged --net=host --user=${user}:${group} -v ~/.kube:/root/.kube -v /tmp:/tmp -v {{ openshift.common.config_base}}:{{ openshift.common.config_base }} -e KUBECONFIG=/root/.kube/config --entrypoint ${cmd} --rm {{ openshift.common.cli_image }} "${@}"
+image=""
+if ! docker inspect -f {% raw %}'{{ .State.Status }}'{% endraw %} {{ openshift.common.service_type }}-master | grep running > /dev/null; then
+>&2 echo """
+
+Warning: {{ openshift.common.service_type }}-master service is not running. Using the latest image.
+"""
+ image=:`docker inspect -f {% raw %}'{{ .Image }}'{% endraw %} {{ openshift.common.service_type }}-master`
+fi
+
+docker run -i --privileged --net=host --user=${user}:${group} -v ~/.kube:/root/.kube -v /tmp:/tmp -v {{ openshift.common.config_base}}:{{ openshift.common.config_base }} -e KUBECONFIG=/root/.kube/config --entrypoint ${cmd} --rm {{ openshift.common.cli_image }}${image} "${@}"