-
Notifications
You must be signed in to change notification settings - Fork 513
[node-agent] Delete systemd unit files and drop-ins only if the unit has been created by node-agent #10918
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
[node-agent] Delete systemd unit files and drop-ins only if the unit has been created by node-agent #10918
Conversation
@oliver-goetz: The label(s) In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
/area robustness |
c0c2950
to
801339b
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
LGTM label has been added. Git tree hash: f12bbf3d3b34aff1e90b0ad118f6ce774fb21442
|
/assign |
…the disk This prevents side effects when the containerd.service unit is changed by extensions too.
801339b
to
1f5d562
Compare
New changes are detected. LGTM label has been removed. |
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
@maboehm Since you recently looked into a similar topic, do you want to take a look at this one? |
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 think I got the gist of the implementation, in general it looks good to me. Just have one suggestion for better documentation.
} else if ok { | ||
return nil, nil |
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.
nit: I spent a couple of minutes understanding why you return nil
is an opertion exists in the map - Maybe the function name isn't the best, or we can add a comment explaining the behavior here.
Because here returning nil
means "I have already determined the state of this file", which is a surprising result of a function getState()
In this PR there is one open point which is the initial state. When the machine is booted for the first time we apply the initial configuration via user data or ignition. @rfranzke and me had a chat about this open point. We came to the conclusion that the node-agent file system is a good solution which addresses the wrong problem 😅 Thus, we go back to an adapted version of the original idea. I opened #11015 for it. We can keep this PR in case we find the right problem for it. /close |
@oliver-goetz: Closed this PR. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
How to categorize this PR?
/area robustness|
/kind bug
What this PR does / why we need it:
Currently
gardener-node-agent
always deletes a systemd unit file and the drop-in folder when the unit was deleted from OperatingSystemConfig.While this correct for units which have been created by
gardener-node-agent
, it incorrectly deletes*.service
file and the drop-in folder for units created by other parties (like default OS units). This can be the case if we use the unit to add additional drop-ins or in order to change the start command.With this PR, unit file and drop-in folder are deleted only if
Unit.Content
of the old unit is not nil.Otherwise, it keeps the unit file and deletes the drop-in files only.
Which issue(s) this PR fixes:
Fixes #10809
Special notes for your reviewer:
/cc @rfranzke
Release note: