Allow specifying custom pod name in --in-pod

Fixes #958: missing or incorrect use of --in-pod and pod-args
Fixes #693: --in-pod 'name' no function

Signed-off-by: norbiros <norbiros@protonmail.com>
Signed-off-by: Norbiros <norbiros@protonmail.com>
This commit is contained in:
norbiros
2025-05-14 21:02:05 +02:00
committed by Povilas Kanapickas
parent bfaf77a506
commit 3d47849d28
6 changed files with 60 additions and 30 deletions

View File

@ -467,6 +467,33 @@ class TestPodmanComposeInPod(unittest.TestCase, RunSubprocessMixin):
# can not actually find this pod because it was not created
self.run_subprocess_assert_returncode(command_rm_pod, 1)
def test_x_podman_in_pod_custom_name(self):
"""
Test that podman-compose will create a pod with a custom name
"""
command_up = [
"python3",
os.path.join(base_path(), "podman_compose.py"),
"-f",
os.path.join(
base_path(),
"tests",
"integration",
"in_pod",
"custom_x-podman_custom_name",
"docker-compose.yml",
),
"up",
"--no-start",
]
try:
self.run_subprocess_assert_returncode(command_up)
finally:
command_rm_pod = ["podman", "pod", "rm", "custom_test_pod_name"]
self.run_subprocess_assert_returncode(command_rm_pod)
def test_x_podman_in_pod_not_exists_command_line_in_pod_empty_string(self):
"""
Test that podman-compose does not allow pod creating when --userns and --pod are set