-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support templates in quadlet #21068
Support templates in quadlet #21068
Conversation
Ephemeral COPR build failed. @containers/packit-build please check. |
e4e4770
to
60d58c4
Compare
No tests added yet, I'm off on PTO, back after new year and will look at that then. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not sure I understood who to use the templates. So, an example is probably needed in the man page.
An example is something like:
If this is installed, then on boot there should be a In addition, if you do
|
@ygalblum do you think you could drive this to completion, while we are sipping Egg Nog? |
A friendly reminder that this PR had no activity for 30 days. |
3998adf
to
6100816
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Unclear to me why the podman machine tests are failing. |
I think they're failing for everyone. For example #21180 |
@mheon are the sqlite tests happy now? Does @alexlarsson need to rebase? |
HyperV is a flake. Mac is an expected failure. |
This is not supported by podman, so we make "foo@bar" into "foo_bar". Signed-off-by: Alexander Larsson <[email protected]>
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 <[email protected]>
For a base template like `[email protected]` the WantedBy and RequiredBy keys does nothing. However, if a DefaultInstance= key is specified that is used by default. However, even if the DefaultInstance= is not given, the Install section is still useful, because you can instantiate the generic template by making a symlink for it, and that symlink will then pick up the instance id. So, for example, this [email protected] will not enable anything on boot. ``` [Container] Image=foo Exec=sleep 100 [Install] WantedBy=other.container ``` But if you have a symlink '[email protected]` -> `[email protected]' then the `foo@instance` service will be marked as wanted by `other`. In addition, even if the main template doesn't have an Install section, you can instantiate it with a symlink like above, and then enabling it using a dropin file like [email protected]/install.conf containing: ``` [Install] WantedBy=other.container ``` Signed-off-by: Alexander Larsson <[email protected]>
…for foo@. This is how systemd works for templates, and it allows us lots of flexibilities. Signed-off-by: Alexander Larsson <[email protected]>
Signed-off-by: Alexander Larsson <[email protected]>
Signed-off-by: Alexander Larsson <[email protected]>
6100816
to
cd5982e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
Really great feature!
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: alexlarsson, vrothberg, ygalblum The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
5e64d4f
into
containers:main
As discussed in #17744 we would like to support template systemd unit, and also have a good way to enable them.
This PR makes the service files work, and adds support for
[Install]
to handle enabling default instances as well as individual instances by using symlinks.