From 04c1b9fab80d761b2c503bc68db3974d35f16a4a Mon Sep 17 00:00:00 2001 From: "KAVVA, JAGAN MOHAN REDDY (jk330k)" Date: Tue, 26 Nov 2019 06:27:20 -0600 Subject: [PATCH] Etcdctl utility container image python and Ubuntu upgrades Currently etcdctl utility container image is built using Ubuntu 16.04 so upgrading it to use Ubuntu Bionic and also upgrading Python 2.x to 3.x. Change-Id: I24212878fcb004f7043d78b7cffb9364cb745e97 --- charts/etcdctl-utility/templates/bin/_start.sh.tpl | 8 ++++---- .../templates/bin/utility/_etcdctl-utility-rootwrap.tpl | 2 +- charts/etcdctl-utility/values.yaml | 2 +- ...Dockerfile.ubuntu_xenial => Dockerfile.ubuntu_bionic} | 9 ++++----- zuul.d/etcdctl-utility.yaml | 2 +- 5 files changed, 11 insertions(+), 12 deletions(-) rename images/etcdctl-utility/{Dockerfile.ubuntu_xenial => Dockerfile.ubuntu_bionic} (93%) diff --git a/charts/etcdctl-utility/templates/bin/_start.sh.tpl b/charts/etcdctl-utility/templates/bin/_start.sh.tpl index c7288d2f..d50546cf 100644 --- a/charts/etcdctl-utility/templates/bin/_start.sh.tpl +++ b/charts/etcdctl-utility/templates/bin/_start.sh.tpl @@ -18,7 +18,7 @@ set -ex sed -i 's/$PrivDropToUser syslog/$PrivDropToUser nobody/' /etc/rsyslog.conf /etc/init.d/rsyslog start -sed -i "/rootwrap_logger.setLevel/s/.*/#&/" /usr/lib/python2.7/dist-packages/oslo_rootwrap/wrapper.py -sed -i "/handler.setFormatter/s/.*/#&/" /usr/lib/python2.7/dist-packages/oslo_rootwrap/wrapper.py -sed -i "/os.path.basename/s/.*/#&/" /usr/lib/python2.7/dist-packages/oslo_rootwrap/wrapper.py -sed -i "/rootwrap_logger.addHandler/s/.*/#&/" /usr/lib/python2.7/dist-packages/oslo_rootwrap/wrapper.py +sed -i "/rootwrap_logger.setLevel/s/.*/#&/" /usr/lib/python3/dist-packages/oslo_rootwrap/wrapper.py +sed -i "/handler.setFormatter/s/.*/#&/" /usr/lib/python3/dist-packages/oslo_rootwrap/wrapper.py +sed -i "/os.path.basename/s/.*/#&/" /usr/lib/python3/dist-packages/oslo_rootwrap/wrapper.py +sed -i "/rootwrap_logger.addHandler/s/.*/#&/" /usr/lib/python3/dist-packages/oslo_rootwrap/wrapper.py diff --git a/charts/etcdctl-utility/templates/bin/utility/_etcdctl-utility-rootwrap.tpl b/charts/etcdctl-utility/templates/bin/utility/_etcdctl-utility-rootwrap.tpl index 86e0787a..a3c9d1d6 100644 --- a/charts/etcdctl-utility/templates/bin/utility/_etcdctl-utility-rootwrap.tpl +++ b/charts/etcdctl-utility/templates/bin/utility/_etcdctl-utility-rootwrap.tpl @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/python3 {{/* Copyright 2019 The Openstack-Helm Authors. diff --git a/charts/etcdctl-utility/values.yaml b/charts/etcdctl-utility/values.yaml index 786a5c3b..91ad9dd1 100644 --- a/charts/etcdctl-utility/values.yaml +++ b/charts/etcdctl-utility/values.yaml @@ -26,7 +26,7 @@ release_group: null images: pull_policy: IfNotPresent tags: - etcdctl_utility: 'quay.io/airshipit/porthole-etcdctl-utility:latest-ubuntu_xenial' + etcdctl_utility: 'quay.io/airshipit/porthole-etcdctl-utility:latest-ubuntu_bionic' image_repo_sync: docker.io/docker:18.09.02 pull_policy: "IfNotPresent" local_registry: diff --git a/images/etcdctl-utility/Dockerfile.ubuntu_xenial b/images/etcdctl-utility/Dockerfile.ubuntu_bionic similarity index 93% rename from images/etcdctl-utility/Dockerfile.ubuntu_xenial rename to images/etcdctl-utility/Dockerfile.ubuntu_bionic index 412d4654..17c48e1b 100644 --- a/images/etcdctl-utility/Dockerfile.ubuntu_xenial +++ b/images/etcdctl-utility/Dockerfile.ubuntu_bionic @@ -1,4 +1,4 @@ -ARG FROM=ubuntu:16.04 +ARG FROM=docker.io/ubuntu:bionic FROM ${FROM} LABEL org.opencontainers.image.authors='airship-discuss@lists.airshipit.org, irc://#airshipit@freenode' \ @@ -23,12 +23,11 @@ RUN set -xe && \ apt-get install -y \ bash \ moreutils \ - python-oslo.rootwrap \ + python3 \ + python3-pip \ python3-oslo.rootwrap \ - screen \ sudo \ - rsyslog \ - vim && \ + rsyslog && \ TMP_DIR=$(mktemp --directory) && \ cd ${TMP_DIR} && \ curl -sSL https://github.com/coreos/etcd/releases/download/v${ETCDCTL_VERSION}/etcd-v${ETCDCTL_VERSION}-linux-amd64.tar.gz \ diff --git a/zuul.d/etcdctl-utility.yaml b/zuul.d/etcdctl-utility.yaml index 9ca7d514..f54b7659 100644 --- a/zuul.d/etcdctl-utility.yaml +++ b/zuul.d/etcdctl-utility.yaml @@ -17,7 +17,7 @@ parent: &parent airship-porthole-images vars: image_name: &image_name porthole-etcdctl-utility - distro_suffix: &distro_suffix ubuntu_xenial + distro_suffix: &distro_suffix ubuntu_bionic files: - ^images/etcdctl-utility/.*$ - ^charts/etcdctl-utility/.*$