From b201a903facc089382131b96c32353dbf9b46e3e Mon Sep 17 00:00:00 2001 From: yatinkarel Date: Fri, 6 Nov 2020 11:58:19 +0530 Subject: [PATCH] Map build host repos to distro.repos.d instead of yum.repos.d Currently, when building container images, we are overriding the ubi image repos with the repos configured in the host. Effectively, this is removing ubi repo config from the image build environment which most of the times is not a problem as centos is on sync with ubi, but in some cases as after RHEL 8.3 release, ubi is ahead of CentOS and need packages from the ubi repo itself. This patch is bind mounting the repos config from build host in distro.repos.d instead of yum.repos.d. In that way, both the repos configured by default in the image (ubi repos) and the ones in the host are available. Depends-On: https://review.opendev.org/c/openstack/tripleo-common/+/765076 Closes-Bug: #1902846 Change-Id: I55f4b8cf2ad971e196fbd06db743d07ce3135ea8 (cherry picked from commit a4fdf46d83a91e8cbe8f40abc79d94a1c31dc592) --- .../tests/v2/container_image/test_tripleo_container_image.py | 2 +- tripleoclient/v2/tripleo_container_image.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tripleoclient/tests/v2/container_image/test_tripleo_container_image.py b/tripleoclient/tests/v2/container_image/test_tripleo_container_image.py index 55290bd2f..7b5aebfa7 100644 --- a/tripleoclient/tests/v2/container_image/test_tripleo_container_image.py +++ b/tripleoclient/tests/v2/container_image/test_tripleo_container_image.py @@ -175,7 +175,7 @@ class TestContainerImages(deploy_fakes.TestDeployOvercloud): ( "volumes", [ - "/etc/yum.repos.d:/etc/yum.repos.d:z", + "/etc/yum.repos.d:/etc/distro.repos.d:z", "/etc/pki/rpm-gpg:/etc/pki/rpm-gpg:z", "bind/mount", ], diff --git a/tripleoclient/v2/tripleo_container_image.py b/tripleoclient/v2/tripleo_container_image.py index 90fc545a5..45efcfb76 100644 --- a/tripleoclient/v2/tripleo_container_image.py +++ b/tripleoclient/v2/tripleo_container_image.py @@ -194,7 +194,7 @@ class Build(command.Command): dest="volumes", metavar="", default=[ - "/etc/yum.repos.d:/etc/yum.repos.d:z", + "/etc/yum.repos.d:/etc/distro.repos.d:z", "/etc/pki/rpm-gpg:/etc/pki/rpm-gpg:z", ], action="append",