From 5b10504b5e678f31f52c6edd075e417a901eb3cc Mon Sep 17 00:00:00 2001 From: sivel / Matt Martz Date: Wed, 8 Apr 2026 11:04:17 -0500 Subject: [PATCH] Fix galaxy container setup issues with podman (#86801) --- .../commands/integration/cloud/galaxy.py | 15 ++++++++++++++- test/lib/ansible_test/_internal/containers.py | 8 ++++++-- 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/test/lib/ansible_test/_internal/commands/integration/cloud/galaxy.py b/test/lib/ansible_test/_internal/commands/integration/cloud/galaxy.py index 51ea000b3f7..e103c3d8462 100644 --- a/test/lib/ansible_test/_internal/commands/integration/cloud/galaxy.py +++ b/test/lib/ansible_test/_internal/commands/integration/cloud/galaxy.py @@ -81,7 +81,20 @@ class GalaxyProvider(CloudProvider): # This container is created separately from the actual galaxy container due to # needing it created for postgres, but the galaxy container has a dependency on knowing the postgres # container id - gdata = run_support_container(self.args, self.platform, self.galaxy_image, 'galaxy-data', [0], start=False) + # + # Podman does not extract the image contents until the container starts, this is not true of Docker. + # The container will start and then immediately exit to conserve resources. + gdata = run_support_container( + self.args, + self.platform, + self.galaxy_image, + 'galaxy-data', + [], + publish_ports=False, + cmd=['/bin/true'], + start=True, + data_container=True, + ) if not gdata: return diff --git a/test/lib/ansible_test/_internal/containers.py b/test/lib/ansible_test/_internal/containers.py index 7842bb14d36..164ac99f8ee 100644 --- a/test/lib/ansible_test/_internal/containers.py +++ b/test/lib/ansible_test/_internal/containers.py @@ -115,6 +115,7 @@ def run_support_container( env: t.Optional[dict[str, str]] = None, options: t.Optional[list[str]] = None, publish_ports: bool = True, + data_container: bool = False, ) -> t.Optional[ContainerDescriptor]: """ Start a container used to support tests, but not run them. @@ -178,6 +179,7 @@ def run_support_container( running, cleanup, env, + data_container, ) with support_containers_mutex: @@ -366,7 +368,7 @@ class ContainerAccess: if self.forwards: ports = list(self.forwards.items()) else: - ports = [(port, port) for port in self.ports] + ports = [(port, port) for port in self.ports or []] return ports @@ -451,7 +453,7 @@ def create_container_database(args: EnvironmentConfig) -> ContainerDatabase: managed: dict[str, dict[str, ContainerAccess]] = {} for name, container in support_containers.items(): - if container.details is None: + if container.data_container: # data containers will not be started, and will be missing details continue if container.details.published_ports: @@ -662,6 +664,7 @@ class ContainerDescriptor: running: bool, cleanup: bool, env: t.Optional[dict[str, str]], + data_container: bool, ) -> None: self.image = image self.context = context @@ -674,6 +677,7 @@ class ContainerDescriptor: self.cleanup = cleanup self.env = env self.details: t.Optional[SupportContainer] = None + self.data_container = data_container def start(self, args: EnvironmentConfig) -> None: """Start the container. Used for containers which are created, but not started."""