Skip to content

Commit 6b4d501

Browse files
authored
Merge pull request #465 from stackhpc/upstream/2025.1-2025-09-05
Synchronise 2025.1 with upstream
2 parents dc91484 + d26c623 commit 6b4d501

File tree

10 files changed

+140
-17
lines changed

10 files changed

+140
-17
lines changed

doc/source/contributor/versions.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ information about package sources.
4747
.. _`Team RabbitMQ 'Cloudsmith' repo (Deb)`: https://www.rabbitmq.com/install-debian.html#apt-cloudsmith
4848
.. _`Team RabbitMQ 'Modern Erlang' PPA`: https://launchpad.net/~rabbitmq/+archive/ubuntu/rabbitmq-erlang
4949
.. _`Team RabbitMQ 'Cloudsmith' repo (RPM)`: https://www.rabbitmq.com/docs/install-rpm#cloudsmith
50-
.. _`openstack-kolla COPR`: https://copr.fedorainfracloud.org/coprs/g/openstack-kolla/rabbitmq-erlang/
50+
.. _`openstack-kolla COPR`: https://copr.fedorainfracloud.org/coprs/g/openstack-kolla/rabbitmq-erlang-26/
5151

5252
.. _`Grafana install guide`: https://grafana.com/grafana/download?platform=linux&edition=oss
5353
.. _`MariaDB Community downloads`: https://mariadb.com/downloads/community/

docker/base/Dockerfile.j2

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,8 @@ COPY dnf.conf /etc/dnf/dnf.conf
7575

7676
{% elif base_arch == 'aarch64' %}
7777
{% set base_yum_repo_files = base_yum_repo_files + [
78-
'copr-rabbitmq-erlang.repo',
78+
'copr-rabbitmq-erlang-26.repo',
79+
'copr-rabbitmq-erlang-27.repo',
7980
] %}
8081

8182
{#

docker/base/copr-rabbitmq-erlang.repo renamed to docker/base/copr-rabbitmq-erlang-26.repo

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22
# from https://github.com/rabbitmq/erlang-rpm/
33
# Thanks to COPR we have aarch64 packages for Rocky Linux
44

5-
[copr-rabbitmq-erlang]
6-
name=openstack-kolla COPR with Erlang build for RabbitMQ
7-
baseurl=https://download.copr.fedorainfracloud.org/results/@openstack-kolla/rabbitmq-erlang/rhel-$releasever-aarch64/
5+
[copr-rabbitmq-erlang-26]
6+
name=openstack-kolla COPR with Erlang 26 build for RabbitMQ
7+
baseurl=https://download.copr.fedorainfracloud.org/results/@openstack-kolla/rabbitmq-erlang-26/rhel-$releasever-aarch64/
88
gpgcheck=1
99
enabled=0
10-
gpgkey=https://download.copr.fedorainfracloud.org/results/@openstack-kolla/rabbitmq-erlang/pubkey.gpg
10+
gpgkey=https://download.copr.fedorainfracloud.org/results/@openstack-kolla/rabbitmq-erlang-26/pubkey.gpg
1111
repo_gpgcheck=0
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# NOTE(hrw): this repository contains rebuild of Erlang package from RabbitMQ team
2+
# from https://github.com/rabbitmq/erlang-rpm/
3+
# Thanks to COPR we have aarch64 packages for Rocky Linux
4+
5+
[copr-rabbitmq-erlang-27]
6+
name=openstack-kolla COPR with Erlang 27 build for RabbitMQ
7+
baseurl=https://download.copr.fedorainfracloud.org/results/@openstack-kolla/rabbitmq-erlang-27/rhel-$releasever-aarch64/
8+
gpgcheck=1
9+
enabled=0
10+
gpgkey=https://download.copr.fedorainfracloud.org/results/@openstack-kolla/rabbitmq-erlang-27/pubkey.gpg
11+
repo_gpgcheck=0

docker/base/mariadb.repo

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[mariadb]
22
name = MariaDB Server
3-
baseurl = https://dlm.mariadb.com/repo/mariadb-server/10.11.11/yum/rhel/$releasever/$basearch
3+
baseurl = https://dlm.mariadb.com/repo/mariadb-server/10.11/yum/rhel/$releasever/$basearch
44
gpgcheck = 1
55
enabled = 0
66
module_hotfixes = 1

docker/base/set_configs.py

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,10 @@ class ConfigFileCommandDiffers(ExitingException):
6868
pass
6969

7070

71+
class StateMismatch(ExitingException):
72+
pass
73+
74+
7175
class ConfigFile(object):
7276

7377
def __init__(self, source, dest, owner=None, perm=None, optional=False,
@@ -583,6 +587,56 @@ def execute_command_check(config):
583587

584588

585589
def execute_config_check(config):
590+
"""Check configuration state consistency and validate config file entries.
591+
592+
This function compares the current config file destinations from the
593+
provided config dictionary with those stored in the defaults state file.
594+
If any destinations are found in the state file but not in the config,
595+
a StateMismatch exception is raised. These missing files would otherwise
596+
be restored or removed depending on their backup state.
597+
598+
After validating consistency, the function performs standard checks on
599+
each declared configuration file, including content, permissions, and
600+
ownership validation.
601+
602+
Args:
603+
config (dict): The configuration dictionary containing 'config_files'
604+
entries as expected by Kolla.
605+
606+
Raises:
607+
StateMismatch: If there are entries in the defaults state not present
608+
in the provided config.
609+
"""
610+
state = get_defaults_state()
611+
612+
# Build a set of all current destination paths from config.json
613+
# If the destination is a directory, we append the
614+
# basename of the source
615+
current_dests = {
616+
entry['dest'] if not entry['dest'].endswith('/') else
617+
os.path.join(entry['dest'], os.path.basename(entry['source']))
618+
for entry in config.get('config_files', [])
619+
if entry.get('dest')
620+
}
621+
622+
# Detect any paths that are present in the state file but
623+
# missing from config.json.
624+
# These would be either restored (if state[dest] has a backup)
625+
# or removed (if dest is null)
626+
removed_dests = [
627+
path for path in state.keys()
628+
if path not in current_dests
629+
]
630+
631+
if removed_dests:
632+
raise StateMismatch(
633+
f"The following config files are tracked in state but missing "
634+
f"from config.json. "
635+
f"They would be restored or removed: {sorted(removed_dests)}"
636+
)
637+
638+
# Perform the regular content, permissions, and ownership
639+
# checks on the declared files
586640
for data in config.get('config_files', []):
587641
config_file = ConfigFile(**data)
588642
config_file.check()

kolla/template/repos.yaml

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@ centos-aarch64:
2323
crb: "crb"
2424
docker-ce: "docker-ce"
2525
epel: "epel"
26-
erlang: "copr-rabbitmq-erlang"
26+
erlang-26: "copr-rabbitmq-erlang-26"
27+
erlang-27: "copr-rabbitmq-erlang-27"
2728
extras: "extras"
2829
fluentd: "fluent-package-lts"
2930
grafana: "grafana"
@@ -72,7 +73,7 @@ debian:
7273
component: "stable"
7374
gpg_key: "influxdb.asc"
7475
mariadb:
75-
url: "https://dlm.mariadb.com/repo/mariadb-server/10.11.11/repo/debian"
76+
url: "https://dlm.mariadb.com/repo/mariadb-server/10.11/repo/debian"
7677
suite: "bookworm"
7778
component: "main"
7879
gpg_key: "mariadb.gpg"
@@ -129,7 +130,7 @@ debian-aarch64:
129130
component: "stable"
130131
gpg_key: "influxdb.asc"
131132
mariadb:
132-
url: "https://dlm.mariadb.com/repo/mariadb-server/10.11.11/repo/debian"
133+
url: "https://dlm.mariadb.com/repo/mariadb-server/10.11/repo/debian"
133134
suite: "bookworm"
134135
component: "main"
135136
gpg_key: "mariadb.gpg"
@@ -181,7 +182,8 @@ rocky-aarch64:
181182
crb: "crb"
182183
docker-ce: "docker-ce"
183184
epel: "epel"
184-
erlang: "copr-rabbitmq-erlang"
185+
erlang-26: "copr-rabbitmq-erlang-26"
186+
erlang-27: "copr-rabbitmq-erlang-27"
185187
extras: "extras"
186188
fluentd: "fluent-package-lts"
187189
grafana: "grafana"
@@ -203,12 +205,12 @@ ubuntu:
203205
gpg_key: "docker-ce.asc"
204206
erlang-26:
205207
url: "https://ppa.launchpadcontent.net/rabbitmq/rabbitmq-erlang-26/ubuntu"
206-
suite: "jammy"
208+
suite: "noble"
207209
component: "main"
208210
gpg_key: "erlang-ppa.gpg"
209211
erlang-27:
210212
url: "https://ppa.launchpadcontent.net/rabbitmq/rabbitmq-erlang-27/ubuntu"
211-
suite: "jammy"
213+
suite: "noble"
212214
component: "main"
213215
gpg_key: "erlang-ppa.gpg"
214216
fluentd:
@@ -228,7 +230,7 @@ ubuntu:
228230
component: "stable"
229231
gpg_key: "influxdb.asc"
230232
mariadb:
231-
url: "https://dlm.mariadb.com/repo/mariadb-server/10.11.11/repo/ubuntu"
233+
url: "https://dlm.mariadb.com/repo/mariadb-server/10.11/repo/ubuntu"
232234
suite: "noble"
233235
component: "main"
234236
gpg_key: "mariadb.gpg"
@@ -261,12 +263,12 @@ ubuntu-aarch64:
261263
gpg_key: "docker-ce.asc"
262264
erlang-26:
263265
url: "https://ppa.launchpadcontent.net/rabbitmq/rabbitmq-erlang-26/ubuntu"
264-
suite: "jammy"
266+
suite: "noble"
265267
component: "main"
266268
gpg_key: "erlang-ppa.gpg"
267269
erlang-27:
268270
url: "https://ppa.launchpadcontent.net/rabbitmq/rabbitmq-erlang-27/ubuntu"
269-
suite: "jammy"
271+
suite: "noble"
270272
component: "main"
271273
gpg_key: "erlang-ppa.gpg"
272274
fluentd:
@@ -286,7 +288,7 @@ ubuntu-aarch64:
286288
component: "stable"
287289
gpg_key: "influxdb.asc"
288290
mariadb:
289-
url: "https://dlm.mariadb.com/repo/mariadb-server/10.11.11/repo/ubuntu"
291+
url: "https://dlm.mariadb.com/repo/mariadb-server/10.11/repo/ubuntu"
290292
suite: "noble"
291293
component: "main"
292294
gpg_key: "mariadb.gpg"
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
fixes:
3+
- |
4+
Fixes set_configs.py not detecting removed config files
5+
during --check, which prevented container restart when
6+
needed. `LP#2114173 <https://launchpad.net/bugs/2114173>`__
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
upgrade:
3+
- |
4+
Switches Erlang RPMs on aarch64 to a versioned Erlang 26 or 27 repository,
5+
due to Fedora COPR not supporting multiple package versions in one repo.

tests/test_set_config.py

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -875,3 +875,47 @@ def test_handle_defaults_state_exist_config_restored(
875875

876876
# Verify that the updated state was saved
877877
mock_set_defaults_state.assert_called_once_with(expected_state)
878+
879+
880+
class ExecuteConfigCheckStateMismatchTest(base.BaseTestCase):
881+
882+
@mock.patch.object(set_configs, 'get_defaults_state')
883+
def test_execute_config_check_raises_state_mismatch(
884+
self, mock_get_defaults_state
885+
):
886+
"""Test execute_config_check() when state has extra config file.
887+
888+
This test simulates the scenario where the state file contains
889+
a destination that no longer exists in config.json. It verifies:
890+
- get_defaults_state() returns a state with an extra entry.
891+
- execute_config_check() raises StateMismatch when config.json
892+
omits a tracked destination.
893+
"""
894+
config = {
895+
"command": "/bin/true",
896+
"config_files": [
897+
{
898+
"source": "/etc/foo/foo.conf",
899+
"dest": "/etc/foo/foo.conf",
900+
"owner": "user1",
901+
"perm": "0644"
902+
}
903+
]
904+
}
905+
906+
mock_get_defaults_state.return_value = {
907+
"/etc/foo/foo.conf": {
908+
"source": "/etc/foo/foo.conf",
909+
"preserve_properties": True,
910+
"dest": "/etc/kolla/defaults/etc/foo/foo.conf"
911+
},
912+
"/etc/old/obsolete.conf": {
913+
"source": "/etc/old/obsolete.conf",
914+
"preserve_properties": True,
915+
"dest": "/etc/kolla/defaults/etc/old/obsolete.conf"
916+
}
917+
}
918+
919+
self.assertRaises(set_configs.StateMismatch,
920+
set_configs.execute_config_check,
921+
config)

0 commit comments

Comments
 (0)