summaryrefslogtreecommitdiffstats
path: root/roles/openshift_cli
diff options
context:
space:
mode:
authorDevan Goodwin <dgoodwin@redhat.com>2016-06-10 10:47:11 -0300
committerDevan Goodwin <dgoodwin@redhat.com>2016-06-10 10:47:11 -0300
commitdb711081e6c1b2b676c212b0eeba95da9cb9f2c5 (patch)
treef7bb220893b9e76b4d6797e441ed50bf23d51166 /roles/openshift_cli
parent755a48c4ebf1061ce19892e5378fba769027bfc1 (diff)
parentfea08b9ba213b69667e103ff9dfd4383218e9eac (diff)
downloadopenshift-db711081e6c1b2b676c212b0eeba95da9cb9f2c5.tar.gz
openshift-db711081e6c1b2b676c212b0eeba95da9cb9f2c5.tar.bz2
openshift-db711081e6c1b2b676c212b0eeba95da9cb9f2c5.tar.xz
openshift-db711081e6c1b2b676c212b0eeba95da9cb9f2c5.zip
Merge branch 'master' into upgrade33
Diffstat (limited to 'roles/openshift_cli')
-rw-r--r--roles/openshift_cli/tasks/main.yml2
-rw-r--r--roles/openshift_cli/templates/openshift.j28
2 files changed, 7 insertions, 3 deletions
diff --git a/roles/openshift_cli/tasks/main.yml b/roles/openshift_cli/tasks/main.yml
index fe6672a47..cdd0564c7 100644
--- a/roles/openshift_cli/tasks/main.yml
+++ b/roles/openshift_cli/tasks/main.yml
@@ -9,7 +9,7 @@
# TODO: handle no openshift_version set?
- name: Pull CLI Image
command: >
- docker pull {{ openshift.common.cli_image }}:v{{ openshift_version }}
+ docker pull {{ openshift.common.cli_image }}{{ ':v' + openshift_version if openshift_version is defined and openshift_version != '' else '' }}
when: openshift.common.is_containerized | bool
- name: Create /usr/local/bin/openshift cli wrapper
diff --git a/roles/openshift_cli/templates/openshift.j2 b/roles/openshift_cli/templates/openshift.j2
index 501796b0b..1c82e02a2 100644
--- a/roles/openshift_cli/templates/openshift.j2
+++ b/roles/openshift_cli/templates/openshift.j2
@@ -5,7 +5,7 @@ fi
cmd=`basename $0`
user=`id -u`
group=`id -g`
-image_tag=v{{ openshift_version }}
+image_tag="v{{ openshift_version }}"
>&2 echo """
================================================================================
@@ -21,4 +21,8 @@ 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_tag} "${@}"
+if [ -n "$image_tag" ]; then
+ image_tag=":$image_tag"
+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_tag} "${@}"