From a192193c55e2f83dc6e376f2a4d88d18967110d1 Mon Sep 17 00:00:00 2001 From: Matt Clay Date: Wed, 14 Feb 2024 10:07:41 -0800 Subject: [PATCH] Limit Alpine 3.18 test hacks to that version --- .../targets/ansible-test-container/runme.py | 23 +++++++++++-------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/test/integration/targets/ansible-test-container/runme.py b/test/integration/targets/ansible-test-container/runme.py index 498e8e7b807..ec42e232d13 100755 --- a/test/integration/targets/ansible-test-container/runme.py +++ b/test/integration/targets/ansible-test-container/runme.py @@ -1069,17 +1069,22 @@ class ApkBootstrapper(Bootstrapper): def run(cls) -> None: """Run the bootstrapper.""" # The `openssl` package is used to generate hashed passwords. - # crun added as podman won't install it as dep if runc is present - # but we don't want runc as it fails - # The edge `crun` package installed below requires ip6tables, and in - # edge, the `iptables` package includes `ip6tables`, but in 3.18 they - # are separate. Remove `ip6tables` once we update to 3.19. - packages = ['docker', 'podman', 'openssl', 'crun', 'ip6tables'] + # The `crun` package must be explicitly installed since podman won't install it as dep if `runc` is present. + packages = ['docker', 'podman', 'openssl', 'crun'] + + if os_release.version_id.startswith('3.18.'): + # The 3.19 `crun` package installed below requires `ip6tables`, but depends on the `iptables` package. + # In 3.19, the `iptables` package includes `ip6tables`, but in 3.18 they are separate packages. + # Remove once 3.18 is no longer tested. + packages.append('ip6tables') run_command('apk', 'add', *packages) - # 3.18 only contains crun 1.8.4, to get 1.9.2 to resolve the run/shm issue, install crun from 3.19 - # Remove once we update to 3.19 - run_command('apk', 'upgrade', '-U', '--repository=http://dl-cdn.alpinelinux.org/alpine/v3.19/community', 'crun') + + if os_release.version_id.startswith('3.18.'): + # 3.18 only contains `crun` 1.8.4, to get a newer version that resolves the run/shm issue, install `crun` from 3.19. + # Remove once 3.18 is no longer tested. + run_command('apk', 'upgrade', '-U', '--repository=http://dl-cdn.alpinelinux.org/alpine/v3.19/community', 'crun') + run_command('service', 'docker', 'start') run_command('modprobe', 'tun')