diff options
| author | Jenkins <jenkins@review.openstack.org> | 2017-05-15 17:08:59 +0000 |
|---|---|---|
| committer | Gerrit Code Review <review@openstack.org> | 2017-05-15 17:08:59 +0000 |
| commit | 819557fdd09d82aa9d4f535b9a962f6548a2bbae (patch) | |
| tree | e458e84f16ad8ee8923b23aa6b7feb0acf27281e /docker | |
| parent | c72c001e7f45f9416b13d64c7d6833ff8ea86647 (diff) | |
| parent | 43de60caaf7cc592b6397c844ef35b2f66e8dd4b (diff) | |
| download | kolla-819557fdd09d82aa9d4f535b9a962f6548a2bbae.tar.gz kolla-819557fdd09d82aa9d4f535b9a962f6548a2bbae.zip | |
Merge "introduce 'install_kubectl' macro"
Diffstat (limited to 'docker')
| -rw-r--r-- | docker/kubetoolbox/Dockerfile.j2 | 10 | ||||
| -rw-r--r-- | docker/macros.j2 | 14 | ||||
| -rw-r--r-- | docker/magnum/magnum-conductor/Dockerfile.j2 | 12 |
3 files changed, 16 insertions, 20 deletions
diff --git a/docker/kubetoolbox/Dockerfile.j2 b/docker/kubetoolbox/Dockerfile.j2 index 6cd8f6dc3..34f7695a9 100644 --- a/docker/kubetoolbox/Dockerfile.j2 +++ b/docker/kubetoolbox/Dockerfile.j2 @@ -3,13 +3,6 @@ LABEL maintainer="{{ maintainer }}" name="{{ image_name }}" build-date="{{ build {% block kubetoolbox_header %}{% endblock %} -{% if base_arch != 'x86_64' %} - -RUN echo 'There is no "kubectl" binary for {{ base_arch }}' \ - && /bin/false - -{% endif %} - {% import "macros.j2" as macros with context %} {% set kubetoolbox_packages = [ @@ -21,8 +14,7 @@ RUN echo 'There is no "kubectl" binary for {{ base_arch }}' \ {{ macros.install_packages(kubetoolbox_packages | customizable("packages")) }} {% block kubetoolbox_install_kube_binary %} -RUN curl -o /usr/bin/kubectl http://storage.googleapis.com/kubernetes-release/release/v1.4.0/bin/linux/amd64/kubectl \ - && chmod 755 /usr/bin/kubectl + {{ macros.install_kubectl() }} {% endblock %} {% block kubetoolbox_footer %}{% endblock %} diff --git a/docker/macros.j2 b/docker/macros.j2 index e40206071..479d33ff8 100644 --- a/docker/macros.j2 +++ b/docker/macros.j2 @@ -48,3 +48,17 @@ RUN apt-get -y install --no-install-recommends haproxy \ && apt-get -y install -f \ && apt-get clean {% endmacro %} + +{% macro install_kubectl() %} + {% if base_arch == 'x86_64' %} + ENV KUBE_ARCH=amd64 + {% elif base_arch == 'aarch64' %} + ENV KUBE_ARCH=arm64 + {% else %} + RUN echo 'There is no "kubectl" binary for {{ base_arch }}' \ + && /bin/false + {% endif %} + + RUN curl -o /usr/bin/kubectl http://storage.googleapis.com/kubernetes-release/release/v1.5.4/bin/linux/${KUBE_ARCH}/kubectl \ + && chmod 755 /usr/bin/kubectl +{% endmacro %} diff --git a/docker/magnum/magnum-conductor/Dockerfile.j2 b/docker/magnum/magnum-conductor/Dockerfile.j2 index 518881fad..e080e3b86 100644 --- a/docker/magnum/magnum-conductor/Dockerfile.j2 +++ b/docker/magnum/magnum-conductor/Dockerfile.j2 @@ -3,13 +3,6 @@ LABEL maintainer="{{ maintainer }}" name="{{ image_name }}" build-date="{{ build {% block magnum_conductor_header %}{% endblock %} -{% if base_arch != 'x86_64' %} - -RUN echo 'There is no "kubectl" binary for {{ base_arch }}' \ - && /bin/false - -{% endif %} - {% import "macros.j2" as macros with context %} {% if install_type == 'binary' %} @@ -26,10 +19,7 @@ RUN echo 'There is no "kubectl" binary for {{ base_arch }}' \ {% endif %} {{ macros.install_packages(magnum_conductor_packages | customizable("packages")) }} -# Install kubectl binary -RUN curl -Lo /usr/local/bin/kubectl https://storage.googleapis.com/kubernetes-release/release/v1.2.0/bin/linux/amd64/kubectl \ - && chmod +x /usr/local/bin/kubectl - +{{ macros.install_kubectl() }} {% endif %} {% block magnum_conductor_footer %}{% endblock %} |
