aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorMark Goddard <mark@stackhpc.com>2019-10-27 11:43:01 +0000
committerRadosław Piliszek <radoslaw.piliszek@gmail.com>2019-10-28 12:53:20 +0100
commitfe00a87ec8e6257ad1724b342b70811c03117b58 (patch)
treee2e5ee83fffa7a1bbdd00b01303df9e9179c9b8c /tests
parent2e908723ac0ae1bf066a7c53a2bfd219fd3df475 (diff)
downloadkolla-fe00a87ec8e6257ad1724b342b70811c03117b58.tar.gz
kolla-fe00a87ec8e6257ad1724b342b70811c03117b58.zip
Remove /var/yum/cache from CentOS base image
Since https://review.opendev.org/#/c/682600/, the following lines result in /var/yum/cache being present in one of the layers of the base image: RUN {{ macros.install_packages(base_centos_yum_repo_packages | customizable("centos_yum_repo_packages"), chain=True, clean=False) }} \ {% for repo in base_centos_yum_repos_to_disable | customizable('centos_yum_repos_to_disable') -%} && yum-config-manager --disable {{ repo }} \ {% endfor -%} {% for key in base_centos_yum_repo_keys | customizable('centos_yum_repo_keys') -%} && rpm --import {{ key }} \ {% endfor -%} && /bin/true {% block base_centos_repo_overrides_post_yum %}{% endblock %} RUN {{ macros.rpm_security_update(clean_package_cache) }} This is because it is not cleaned in the first RUN statement. This adds 76MB to the image. Also, using two separate RUNs which results in an extra 23MB due to updates to /var/lib/rpm/Packages. Found via https://github.com/wagoodman/dive. Change-Id: I0302ee1dfc10a2b7df127ac6a7764a84b1d74a33 Closes-Bug: #1850036
Diffstat (limited to 'tests')
-rw-r--r--tests/templates/template_overrides.j26
1 files changed, 2 insertions, 4 deletions
diff --git a/tests/templates/template_overrides.j2 b/tests/templates/template_overrides.j2
index 3dc7035ca..e69eab450 100644
--- a/tests/templates/template_overrides.j2
+++ b/tests/templates/template_overrides.j2
@@ -52,16 +52,14 @@ RUN sed -i \
{% block base_centos_repo_overrides_post_yum %}
{% endraw %}
-
-RUN sed -i \
+ && sed -i \
-e "/^mirrorlist/ d" \
-e "s|^#baseurl=http://mirror.centos.org|baseurl=http://{{ nodepool_mirror_host }}|" \
/etc/yum.repos.d/CentOS-*.repo \
&& sed -i \
-e "/^metalink/ d" \
-e "s|^#baseurl=http://download.fedoraproject.org/pub|baseurl=http://{{ nodepool_mirror_host }}|" \
- /etc/yum.repos.d/epel*.repo
-
+ /etc/yum.repos.d/epel*.repo \
{% raw %}
{% endblock %}