-
Epic
-
Resolution: Unresolved
-
Undefined
-
None
-
None
-
None
-
QUADLETGEN
-
False
-
-
False
-
Not Selected
-
In Progress
-
rhel-container-tools
-
0% To Do, 50% In Progress, 50% Done
Problem: Quadlets are a powerful method for managing Podman objects using systemd, but they currently have a steep learning curve because they must be written manually. This is a significant barrier to adoption for users who are not yet familiar with Quadlet syntax or the corresponding systemd unit file options.
Goal: To significantly improve the user experience (UX) and lower the barrier to entry for Podman Quadlets. We want to make it simple for a user to take an existing, working Podman object (like a container they created with podman run) and instantly generate a Quadlet file from it. This provides an immediate "happy path" for using Quadlets and serves as a powerful learning tool, as users can inspect the generated files to understand the syntax.
Proposed Solution: We will introduce a new feature (e.g., podman quadlet generate ...) that can inspect an existing Podman object and output a corresponding Quadlet definition file.
Technical Strategy: A direct reverse-mapping from the Podman database back to Quadlet options is prohibitively complex, as many initial CLI options are decomposed and not stored 1:1.
Instead, we will pursue a new implementation strategy:
- Rework Option Parsing: Refactor Podman's CLI option parsing and Quadlet parsing to introduce a unified, inherent relationship between a given CLI option (e.g., --port) and its corresponding Quadlet option (e.g., Port).
- Store Specgen: Modify the Podman database to store a copy of the parsed CLI options (in the form of the Specgen struct) alongside the container or object. This Specgen will serve as the "source of truth" for the user's original intent.
- Implement Generator: Create the new podman quadlet generate command. This command will retrieve the stored Specgen for a given object and use the new unified parsing logic to translate it directly into a valid Quadlet file.
Acceptance Criteria:
- A user can successfully generate a valid .container Quadlet file from an existing container.
- A user can successfully generate a valid .pod Quadlet file from an existing pod.
- A user can successfully generate a valid .volume Quadlet file from an existing volume.
- (TBD - Lower Priority) A user can successfully generate a valid .image Quadlet file for a pulled image.
- The generated Quadlet file contains all the relevant options (e.g., ports, mounts, environment variables) from the original object.
- The generated Quadlet file can be placed in the correct systemd directory, and systemctl --user daemon-reload successfully generates a matching service unit.
- The feature is covered by comprehensive integration and end-to-end tests.
- The new feature is clearly documented on podman.io and in the relevant man pages (e.g., podman-quadlet-generate(1)).