7 Commits

Author SHA1 Message Date
7e1942ed46 systemd.parser: Add GetTemplateParts()
This helper splits out a templated filename into the base template and
the instance name. This will be used later.

Signed-off-by: Alexander Larsson <alexl@redhat.com>
2024-01-26 13:57:39 +01:00
70a53cb76a Quadlet - fix trailing whitespaces handling
Remove all trailing white spaces from all lines before the line by line
processing
Add test
Exclude the unit file used for the test from whitespace check

Signed-off-by: Ygal Blum <ygal.blum@gmail.com>
2024-01-02 12:26:44 +02:00
8ee2622028 quadlet: Support systemd style dropin files
For a source file like `foo.container`, look for drop in named
`foo.container.d/*.conf` and merged them into the main file.  The
dropins are applied in alphabetical order, and files in earlier
diretories override later files with same name.

This is similar to how systemd dropins work, see:
https://www.freedesktop.org/software/systemd/man/latest/systemd.unit.html

Also adds some tests for these

Signed-off-by: Alexander Larsson <alexl@redhat.com>
2023-11-29 13:46:52 +01:00
bc5269f187 Trim whitespace from unit files while parsing
Fixes: https://github.com/containers/podman/issues/18979

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2023-06-25 06:33:37 -04:00
dd428af898 quadlet: Rename parser.LookupBoolean to LookupBooleanWithDefault
We add a regular LookupBoolean that can fail lookups, which is used by
the WithDefault version. We want to use this directly later in some places.

It is fina to change API here because this has not been in a release yet.

Signed-off-by: Alexander Larsson <alexl@redhat.com>
2022-12-20 10:38:49 +01:00
efbad590d7 Run codespell on code
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2022-11-04 10:57:41 -04:00
b4374f2bd9 move quadlet packages into pkg/systemd
Reduce the number of top-level packages in ./pkg by moving quadlet
packages under ./pkg/systemd.

[NO NEW TESTS NEEDED] - no functional change.

Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
2022-10-19 13:38:27 +02:00