Plain key=value quadlet_options (e.g. AutoUpdate=registry) were placed
after the [Service] section, making them part of [Service] instead of
[Container]. Split quadlet_options into plain options (appended to the
main section) and section blocks (appended after [Service]).
Fix#1017
Signed-off-by: Sagi Shnaidman <sshnaidm@redhat.com>
This commit introduces two new modules for managing Podman Quadlets:
- podman_quadlet: Install and remove Podman Quadlet files
* Supports installing single files, directories, and additional config files
* Implements idempotent state management (present/absent)
* Validates parameters and provides meaningful error messages
* Default force=true for removal operations
* Removed deprecated 'ignore' parameter in favor of built-in idempotency
- podman_quadlet_info: Gather information about installed Quadlets
* Lists all installed quadlets or prints specific quadlet content
* Supports filtering by quadlet kinds (container, pod, network, etc.)
* Provides detailed quadlet metadata including status and paths
Key features:
- Shared utilities in module_utils/podman/quadlet.py for code reuse
- Comprehensive integration tests for both modules
- Full idempotency support for all operations
- Proper handling of edge cases (missing files, malformed quadlets, etc.)
- Check mode support for safe dry-run operations
- Extensive documentation and examples
The modules use relative imports for module_utils to support local
development and testing with the containers.podman collection.
Signed-off-by: Sagi Shnaidman <sshnaidm@redhat.com>
Fix incorrect image URL formation when using separate name and tag parameters
where the tag contains a digest. Previously, tags like "8-bookworm@sha256:..."
would incorrectly use "@" as the delimiter between name and tag, resulting in
malformed URLs like "docker.io/valkey/valkey@8-bookworm@sha256:...".
The issue was in ImageRepository.delimiter logic which used substring matching
("sha256" in tag) instead of checking for pure digest format.
Changes:
- Fix delimiter selection in ImageRepository.__init__() to only use "@" for
pure digests starting with "sha256:", not any tag containing "sha256"
- Add comprehensive unit tests covering all delimiter scenarios
- Add integration tests with real digest validation and edge cases
- Ensure proper URL formation: name:tag@digest vs name@digest
Before: docker.io/valkey/valkey@8-bookworm@sha256:abc123 (broken)
After: docker.io/valkey/valkey:8-bookworm@sha256:abc123 (correct)
Fixes#947
Generated with [Claude Code](https://claude.ai/code)
Signed-off-by: Sagi Shnaidman <sshnaidm@redhat.com>
* podman_container_lib: Added checks for volume opts
Changed the diffparam_volume function to include the volume mount opts.
Signed-off-by: Lucas Benedito <lbenedit@redhat.com>
* Add test for volume mount options
Signed-off-by: Lucas Benedito <lbenedit@redhat.com>
---------
Signed-off-by: Lucas Benedito <lbenedit@redhat.com>
This typo prevents the quadlet generator from picking up
--cpus and --platform options.
Signed-off-by: InsideTheVoid <824767+InsideTheVoid@users.noreply.github.com>
Adjust quadlet parameters to set rootfs as image and clear image field when rootfs container is being used.
Signed-off-by: Nikita Tokarchuk <nikita@tokarch.uk>
The code should be setting `--exit-policy` to the value of `params['exit_policy']`
instead of `params['gpus']`
Signed-off-by: Rich Megginson <rmeggins@redhat.com>