Quadlet - make sure the order of the UnitsDir is deterministic

Change getUnitDirs to maintain a slice in addition to the map and return the slice
Add helper functions to make the code more readable
Adjust unit tests
Restore system test

Signed-off-by: Ygal Blum <ygal.blum@gmail.com>
This commit is contained in:
Ygal Blum
2024-09-24 17:43:39 -04:00
parent 4e38381d37
commit ebbec00b0d
4 changed files with 126 additions and 99 deletions

View File

@@ -713,7 +713,7 @@ var _ = Describe("quadlet system generator", func() {
Expect(session).Should(Exit(0))
current := session.ErrorToStringArray()
expected := "No files parsed from map[/something:{}]"
expected := "No files parsed from [/something]"
found := false
for _, line := range current {

View File

@@ -221,8 +221,6 @@ EOF
}
@test "quadlet conflict names" {
skip "FIXME: #24047, temporary skip because this is an intense flake"
# If two directories in the search have files with the same name, quadlet should
# only process the first name
dir1=$PODMAN_TMPDIR/$(random_string)
@@ -232,13 +230,13 @@ EOF
cat > $dir1/$quadlet_file <<EOF
[Container]
Image=$IMAGE
Image=quay.io/libpod/this-is-the-one:wewant
Notify=yes
EOF
cat > $dir2/$quadlet_file <<EOF
[Container]
Image=$IMAGE
Image=quay.io/libpod/bad-bad-bad:nonono
Notify=no
EOF
QUADLET_UNIT_DIRS="$dir1:$dir2" run \