summaryrefslogtreecommitdiffstats
path: root/roles/openshift_cli/templates
diff options
context:
space:
mode:
authorBrenton Leanhardt <bleanhar@redhat.com>2016-02-28 16:32:38 -0500
committerBrenton Leanhardt <bleanhar@redhat.com>2016-03-03 09:05:42 -0500
commit7d561bd252a4ddc9e204f31144fbed7fecd99bff (patch)
tree372252fd59dfa4e1f576e54977375621858281d0 /roles/openshift_cli/templates
parent6b25d27ca4ad9458688902d0c3e7c3a9c7b9c15d (diff)
downloadopenshift-7d561bd252a4ddc9e204f31144fbed7fecd99bff.tar.gz
openshift-7d561bd252a4ddc9e204f31144fbed7fecd99bff.tar.bz2
openshift-7d561bd252a4ddc9e204f31144fbed7fecd99bff.tar.xz
openshift-7d561bd252a4ddc9e204f31144fbed7fecd99bff.zip
Correctly set the image tag for containerized installs (and upgrades)
Diffstat (limited to 'roles/openshift_cli/templates')
-rw-r--r--roles/openshift_cli/templates/openshift.j227
1 files changed, 3 insertions, 24 deletions
diff --git a/roles/openshift_cli/templates/openshift.j2 b/roles/openshift_cli/templates/openshift.j2
index e9155e76d..f969a4bab 100644
--- a/roles/openshift_cli/templates/openshift.j2
+++ b/roles/openshift_cli/templates/openshift.j2
@@ -5,10 +5,11 @@ fi
cmd=`basename $0`
user=`id -u`
group=`id -g`
+image_tag={{ image_tag | default(openshift.common.image_tag) }}
>&2 echo """
================================================================================
-ATTENTION: You are running ${cmd} via a wrapper around 'docker run {{ openshift.common.cli_image }}'.
+ATTENTION: You are running ${cmd} via a wrapper around 'docker run {{ openshift.common.cli_image }}:${image_tag}'.
This wrapper is intended only to be used to bootstrap an environment. Please
install client tools on another host once you have granted cluster-admin
privileges to a user.
@@ -20,26 +21,4 @@ See https://docs.openshift.org/latest/cli_reference/get_started_cli.html
=================================================================================
"""
-container="{{ openshift.common.service_type }}-master"
-is_running=false
-
-docker19_status=`docker inspect -f {% raw %}'{{ .State.Status }}'{% endraw %} $container`
-if [ "$docker19_status" == "<no value>" ]; then
- if docker inspect -f {% raw %}'{{ .State.Running }}'{% endraw %} $container | grep -i true > /dev/null; then
- is_running=true
- fi
-elif [ "$docker19_status" == "running" ]; then
- is_running=true
-fi
-
-if $is_running; then
- image=:`docker inspect -f {% raw %}'{{ .Image }}'{% endraw %} {{ openshift.common.service_type }}-master`
-else
- >&2 echo """
-
-Warning: {{ openshift.common.service_type }}-master service is not running. Using the latest image.
- """
- image=:latest
-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} "${@}"
+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_tag} "${@}"