-
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
Allow removing implicit quadlet systemd dependencies #24194
Allow removing implicit quadlet systemd dependencies #24194
Conversation
Ephemeral COPR build failed. @containers/packit-build please check. |
8182de7
to
8b4d085
Compare
The code looks good. But, you will need to add some tests |
Would an e2e test be enough for this? |
Sure. We generally want an E2E or system test, adding both is usually unnecessary. |
8b4d085
to
4d71241
Compare
Should be good now I think |
ccde48a
to
29463da
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, nice work.
pkg/systemd/quadlet/quadlet.go
Outdated
// override the default ones. | ||
service.PrependUnitLine(UnitGroup, "After", "network-online.target") | ||
service.PrependUnitLine(UnitGroup, "Wants", "network-online.target") | ||
if service.LookupBooleanWithDefault(ContainerGroup, KeyQuadletDefaultDependencies, true) { |
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.
Do we really want to add these generic keys to each group? Overall this just adds a ton of duplication in the docs.
And every time we add such a generic option we have to do that over and over again which does not look sane to me.
So maybe is it time to define a [Quadlet]
section and then just name the key DefaultDependencies
under there? This would only need to be documented once and then should work for all units. @ygalblum WDYT?
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 had a similar thought but didn't consider the long-term impact on new features. +1 from my side.
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 agree and I was actually thinking about it for a while now. For example, I would move ContainersConfModule
to there as well (I know, for backward compatibility we'll need to support both)
I'm just not sure we want to force @lambinoo to make this change.
Let's hold this PR for a sec and I'll try to find some time to add this section
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 don't mind. Just pushed (what I think are) the required changes for this!
Left the ContainersConfModule
bit out of this
0da746b
to
90fd1dc
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.
Additional question:
The new Quadlet
section is currently only relevant for .container
, .build
and .image
files. What should be the behaviour if it appears on a different types? I see three options:
- Rename the group to
X-Quadlet
and noop - Error at the Quadlet level
- Noop which will result in a systemd error because of an unrecognized section
I think option 1 is preferable as it will also be future proof.
|
||
| **[Quadlet] options** | **Description** | | ||
|----------------------------|---------------------------------------------------| | ||
| DefaultDependencies=false | Include implicit network dependencies to the unit | |
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.
The example sets the value to false
but the description refers to the case of true
. This might be a bit confusing
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.
Ooops, updated!
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.
Something got reverted here and the original issue is back. I'll take advantage and say that since setting it to true
is redundant, it might be better to leave the false
value and change the description to something like "Disable implicit network..."
90fd1dc
to
6ba0e79
Compare
+1 on renaming. The quadlet section will be used by |
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, Thanks!
Is there a way to retry those podman db test failures? They seem pretty unrelated to quadlet. And I'm not too familiar with Github actions |
We can restart individual ones yes, but if basically all of them are red the problem is in the new changes (expect in very rare cases where some external factor is breaking things) So there is definitely something broken in quadlet that makes this this fail |
Oh, good catch yeah. I did see a lot of those weird "unlikeat" errors before and stopped looking after seeing one. Seems like I forgot a |
2994057
to
426e730
Compare
Looks a bit better, but I can see a pasta related error and a WSL one. |
426e730
to
d01c484
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.
Your latest forced push reverted all the changes made following the comments. I added a comment about the doc
|
||
| **[Quadlet] options** | **Description** | | ||
|----------------------------|---------------------------------------------------| | ||
| DefaultDependencies=false | Include implicit network dependencies to the unit | |
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.
Something got reverted here and the original issue is back. I'll take advantage and say that since setting it to true
is redundant, it might be better to leave the false
value and change the description to something like "Disable implicit network..."
|
||
Add Quadlet's default dependencies to the unit. | ||
|
||
If set to true (the default), Quadlet will add a dependency (After=, Wants=) to `network-online.target` to the generated unit. |
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.
Also here. Since true
is the default, I think it's better to describe the outcome of setting it to false
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.
Updated for both!
d01c484
to
426e730
Compare
Added back everything. The cons oF working on two different workstations and badly keeping track.. |
Quadlet inserts network-online.target Wants/After dependencies to ensure pulling works. Those systemd statements cannot be subsequently reset. In the cases where those dependencies are not wanted, we add a new configuration item called `DefaultDependencies=` in a new section called [Quadlet]. This section is shared between different unit types. fixes containers#24193 Signed-off-by: Farya L. Maerten <me@ltow.me>
426e730
to
bac655a
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
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
thanks
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: lambinoo, Luap99, 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 |
5890190
into
containers:main
Allow removing implicit quadlet systemd dependencies
Quadlet inserts network-online.target Wants/After dependencies to ensure pulling works.
Those systemd statements cannot be subsequently reset.
In the cases where those dependencies are not wanted, we add a new
configuration item called
DefaultDependencies=
in a new section called[Quadlet]. This section is shared between different unit types.
fixes #24193