aboutsummaryrefslogtreecommitdiff
path: root/kolla
diff options
context:
space:
mode:
authorMarcin Juszkiewicz <marcin.juszkiewicz@linaro.org>2021-04-22 11:28:34 +0200
committerMarcin Juszkiewicz <marcin.juszkiewicz@linaro.org>2021-05-06 08:30:17 +0200
commit68fc72cd5d5003025da53cd1160e9cd19367cb10 (patch)
tree4b3a7ea767a919e9a67c81d4a978aaf822d2b440 /kolla
parentdccb1a50e8545900711e2d579c87958ac447569c (diff)
downloadkolla-68fc72cd5d5003025da53cd1160e9cd19367cb10.tar.gz
kolla-68fc72cd5d5003025da53cd1160e9cd19367cb10.zip
base: check for compatible distro using just sh
We allow users to use own image as base one and then we check is it proper distribution version one. And this check is done in different way for CentOS and different for Debian/Ubuntu systems. This patchset uses PRETTY_NAME from /etc/os-release for check. And it is done before anything gets installed so if wrong distribution is used then build process breaks as soon as possible. Change-Id: I22db3cd4cb608332261824626e3b8768821b8dd0
Diffstat (limited to 'kolla')
-rwxr-xr-xkolla/common/config.py11
-rwxr-xr-xkolla/image/build.py4
2 files changed, 8 insertions, 7 deletions
diff --git a/kolla/common/config.py b/kolla/common/config.py
index 23e5ead40..9e56a1ee2 100755
--- a/kolla/common/config.py
+++ b/kolla/common/config.py
@@ -27,11 +27,12 @@ DEFAULT_BASE_TAGS = {
'debian': {'name': 'debian', 'tag': 'bullseye'},
'ubuntu': {'name': 'ubuntu', 'tag': '20.04'},
}
-DISTRO_RELEASE = {
- 'centos': '8',
- 'rhel': '8',
- 'debian': 'testing/unstable',
- 'ubuntu': '20.04',
+# NOTE(hrw): has to match PRETTY_NAME in /etc/os-release
+DISTRO_PRETTY_NAME = {
+ 'centos': 'CentOS Stream 8',
+ 'rhel': 'Red Hat Enterprise Linux 8',
+ 'debian': 'Debian GNU/Linux bullseye',
+ 'ubuntu': 'Ubuntu 20.04',
}
OPENSTACK_RELEASE = 'wallaby'
diff --git a/kolla/image/build.py b/kolla/image/build.py
index 27006e1ac..d09a8b5e9 100755
--- a/kolla/image/build.py
+++ b/kolla/image/build.py
@@ -914,7 +914,7 @@ class KollaWorker(object):
def create_dockerfiles(self):
kolla_version = version.version_info.cached_version_string()
- supported_distro_release = common_config.DISTRO_RELEASE.get(
+ supported_distro_name = common_config.DISTRO_PRETTY_NAME.get(
self.base)
for path in self.docker_build_paths:
template_name = "Dockerfile.j2"
@@ -930,7 +930,7 @@ class KollaWorker(object):
'base_package_type': self.base_package_type,
'debian_arch': self.debian_arch,
'docker_healthchecks': self.docker_healthchecks,
- 'supported_distro_release': supported_distro_release,
+ 'supported_distro_name': supported_distro_name,
'install_metatype': self.install_metatype,
'image_prefix': self.image_prefix,
'infra_image_prefix': self.infra_image_prefix,