Add project parameter for podman quadlet commands
Feature request description
I started to make a try to podman quadlet command and I've seen a missing feature that could be useful. Let me explain via a example. I have a keycloak directory, which has the following files:
- keycloak.pod
- app.container
- db.container
- db.volume
If I install it via podman quadlet install ~/keycloak comamnd, these files are copied without any changes. Which can be problem if other services would also have such generic name.
This could be solved by using a --project paramater in the command like: podman quadlet install --project kc ~/keycloak. If project is omitted, default could be the name of the directory (in this example just keycloak). So files would be like kc-app.container and the systemd service name is kc-app.service. Same for other files.
Furthermore, if I just want to spin up another stack for testing, I could use just podman quadlet install --project kc-test ~/keycloak command.
The same method would work via https link, if it is are a tarball or single file.
Suggest potential solution
The logic flow would something like this:
- If specified path is a https link, download. If it is a tarball, then extract it.
- Create a temporary directory and copy the source files with new prefixed names.
- If any of the copied files have reference to each other (e.g.:
Volume=db.volume:/something), then modify the file content (Volume=kc-db.volume:/something). Same can be applied for BindsTo, After, Requisite and other parts. If they have reference for such files which is not included to the package (e.g.:Network=proxy.network), then it remain untouched. - Make a diff which files are different, then copy onto proper directory (e.g. for user:
~/.config/containers/systemd) and make daemon-reload.
To delete project is just delete files based on naming convention.
Have you considered any alternatives?
Files can have unique names by putting prefixes in advance, but it breaks dynamic a little bit (e.g.: files should be copied and renamed to kc-test to a test environment).
It also could be script or standalone project, but since podman quadlet become a feature (a very nice one, in my opinion) this feature could be netter in Podman repository.
Additional context
No response