summaryrefslogtreecommitdiffstats
path: root/roles/openshift_cli/templates
diff options
context:
space:
mode:
authorDevan Goodwin <dgoodwin@redhat.com>2016-06-06 14:58:02 -0300
committerDevan Goodwin <dgoodwin@redhat.com>2016-06-06 14:58:02 -0300
commitc45c5935df97bb4aa9e8e9067d868371b04a24bf (patch)
tree3c6a60f1b615b6a2adab5d315655de95e90ada4f /roles/openshift_cli/templates
parent0c31d72be3bf32f848eedad9859a81ba858f8c8f (diff)
downloadopenshift-c45c5935df97bb4aa9e8e9067d868371b04a24bf.tar.gz
openshift-c45c5935df97bb4aa9e8e9067d868371b04a24bf.tar.bz2
openshift-c45c5935df97bb4aa9e8e9067d868371b04a24bf.tar.xz
openshift-c45c5935df97bb4aa9e8e9067d868371b04a24bf.zip
Fix Docker 1.10 problems with empty tags and trailing :
Docker 1.10 is no longer tolerant of commands like "docker pull myimage:" when we do not have an image tag in play. Adjust all occurrences with one that only includes the : if a version is defined. Adjust the containerized CLI wrappers for a similar problem.
Diffstat (limited to 'roles/openshift_cli/templates')
-rw-r--r--roles/openshift_cli/templates/openshift.j210
1 files changed, 7 insertions, 3 deletions
diff --git a/roles/openshift_cli/templates/openshift.j2 b/roles/openshift_cli/templates/openshift.j2
index 437e08aab..8a3f3a257 100644
--- a/roles/openshift_cli/templates/openshift.j2
+++ b/roles/openshift_cli/templates/openshift.j2
@@ -5,14 +5,14 @@ fi
cmd=`basename $0`
user=`id -u`
group=`id -g`
-image_tag={{ openshift_version }}
+image_tag="{{ openshift_version }}"
>&2 echo """
================================================================================
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.
+privileges to a user.
{% if openshift.common.deployment_type in ['openshift-enterprise','atomic-enterprise'] %}
See https://docs.openshift.com/enterprise/latest/cli_reference/get_started_cli.html
{% else %}
@@ -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} "${@}"