Skip to content

Commit 0bb6a65

Browse files
seunghun1eebbezak
authored andcommitted
[2024.1 only] Extend base_tag check to cover more ubuntu base image tags
https://hub.docker.com provides base Ubuntu images with two type of namings. For example for Ubuntu Noble, there are ``24.04``, ``noble`` and ``noble-20250127``. Currently whenever Kolla checks base tag to determine which Ubuntu release is being used, it only expects tag of version number. So if users use base tag with release codename, they will not get correct python version or other dependencies. Fixing this by extending all base_tag checks to include case for release codenames. Change-Id: Iab02de97cdde79db540c7336512d7014f9b71753
1 parent 6aba731 commit 0bb6a65

File tree

5 files changed

+15
-8
lines changed

5 files changed

+15
-8
lines changed

docker/base/Dockerfile.j2

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -241,15 +241,15 @@ RUN cat /tmp/kolla_bashrc >> /etc/bash.bashrc \
241241
RUN rm -f /etc/apt/sources.list.d/debian.sources
242242
COPY sources.list.{{ base_distro }} /etc/apt/sources.list
243243
{% elif ( base_distro == 'ubuntu' and base_arch == 'x86_64' ) %}
244-
{% if base_distro_tag.startswith('22.04') %}
244+
{% if base_distro_tag.startswith('22.04') or base_distro_tag.startswith('jammy') %}
245245
COPY sources.list.{{ base_distro }}.jammy /etc/apt/sources.list
246-
{% elif base_distro_tag.startswith('24.04') %}
246+
{% elif base_distro_tag.startswith('24.04') or base_distro_tag.startswith('noble') %}
247247
COPY sources.list.{{ base_distro }}.noble /etc/apt/sources.list
248248
{% endif %}
249249
{% else %}
250-
{% if base_distro_tag.startswith('22.04') %}
250+
{% if base_distro_tag.startswith('22.04') or base_distro_tag.startswith('jammy')%}
251251
COPY sources.list.{{ base_distro }}.jammy.{{ base_arch }} /etc/apt/sources.list
252-
{% elif base_distro_tag.startswith('24.04') %}
252+
{% elif base_distro_tag.startswith('24.04') or base_distro_tag.startswith('noble')%}
253253
COPY sources.list.{{ base_distro }}.noble.{{ base_arch }} /etc/apt/sources.list
254254
{% endif %}
255255
{% endif %}

docker/bifrost/bifrost-base/Dockerfile.j2

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ ENV ANSIBLE_GATHER_TIMEOUT=30
3737
{% block bifrost_ansible_install %}
3838
{%- if base_package_type == 'deb' %}
3939
RUN apt-get --error-on=any update && \
40-
{%- if base_distro_tag.startswith('24.04') %}
40+
{%- if base_distro_tag.startswith('24.04') or base_distro_tag.startswith('noble') %}
4141
bash -c 'export VENV=/var/lib/kolla/venv && \
4242
{# NOTE(darmach): Bumped to ansible-core 2.16 to match Python 3.12 #}
4343
$VENV/bin/pip install "ansible>=9,<10" && \

docker/cinder/cinder-base/Dockerfile.j2

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ LABEL maintainer="{{ maintainer }}" name="{{ image_name }}" build-date="{{ build
3232
] %}
3333
{% endif %}
3434

35-
{% if base_distro_tag.startswith('24.04') %}
35+
{% if base_distro_tag.startswith('24.04') or base_distro_tag.startswith('noble') %}
3636
RUN {{ macros.upper_constraints_version_change("taskflow", "5.6.0", "5.8.0") }}
3737
{% endif %}
3838

kolla/image/kolla_worker.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ def __init__(self, conf):
122122
self.distro_package_manager = 'apt'
123123
self.base_package_type = 'deb'
124124
elif self.base in ['ubuntu']:
125-
if self.base_tag.startswith('24.04'):
125+
if self.base_tag.startswith(('24.04', 'noble')):
126126
self.conf.distro_python_version = "3.12"
127127
else:
128128
self.conf.distro_python_version = "3.10"

kolla/template/methods.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,14 @@ def handle_repos(context, reponames, mode):
9696

9797
repofile = context.get('repos_yaml') or (
9898
os.path.dirname(os.path.realpath(__file__)) +
99-
('/repos-noble.yaml' if base_distro_tag == '24.04' else '/repos.yaml')
99+
(
100+
'/repos-noble.yaml'
101+
if (
102+
base_distro_tag and
103+
base_distro_tag.startswith(('24.04', 'noble'))
104+
)
105+
else '/repos.yaml'
106+
)
100107
)
101108

102109
with open(repofile, 'r') as repos_file:

0 commit comments

Comments
 (0)