Skip to content

Commit 7a8d936

Browse files
test(drivers): keep Podman userns settings unset in default mode
The old default-userns baseline asserted that gateway.toml had no userns, uidmap or gidmap settings. The driver fragment is now their only source, so remove it in default mode instead of only skipping the write. Signed-off-by: Matthew Grossman <[email protected]>
1 parent 90c3d4c commit 7a8d936

1 file changed

Lines changed: 12 additions & 3 deletions

File tree

  • tests/tmachine/ansible/playbooks/drivers/podman

‎tests/tmachine/ansible/playbooks/drivers/podman/userns.yaml‎

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66
# `podman_userns_mode` is default, auto, keep-id or private. Every mode except
77
# default writes its `[openshell.drivers.podman]` settings to
88
# `podman_userns_driver_config`, which the openshell_gateway role (the
9-
# `binaries` installer) appends to gateway.toml. The Podman support crate
10-
# (tests/support/podman) reads the published mode and runs Podman's own
11-
# reference container in it.
9+
# `binaries` installer) appends to gateway.toml; default removes the file. The
10+
# Podman support crate (tests/support/podman) reads the published mode and
11+
# runs Podman's own reference container in it.
1212
---
1313
- name: Podman user namespaces for tests
1414
hosts: all
@@ -58,6 +58,15 @@
5858
mode: "0644"
5959
when: podman_userns_mode != "default"
6060

61+
# The fragment is the only source of userns, uidmap and gidmap settings in
62+
# the rendered gateway.toml, so default mode leaves them unset.
63+
- name: Remove Podman driver user-namespace settings for default mode
64+
become: true
65+
ansible.builtin.file:
66+
path: "{{ podman_userns_driver_config }}"
67+
state: absent
68+
when: podman_userns_mode == "default"
69+
6170
- name: Publish Podman user-namespace test variables
6271
ansible.builtin.include_tasks: ../../test-env.yaml
6372
vars:

0 commit comments

Comments
 (0)