Merge snap-kubelet:gkk/configure-dont-restart into snap-kubelet:master

Proposed by George Kraft
Status: Merged
Approved by: Kevin W Monroe
Approved revision: c25c56f83f1e2792315db870f4a9b24f31c35e8c
Merged at revision: c25c56f83f1e2792315db870f4a9b24f31c35e8c
Proposed branch: snap-kubelet:gkk/configure-dont-restart
Merge into: snap-kubelet:master
Diff against target: 11 lines (+0/-1)
1 file modified
snapcraft.yaml.in (+0/-1)
Reviewer Review Type Date Requested Status
Kevin W Monroe Approve
Review via email: mp+444585@code.launchpad.net

Commit message

Don't restart kubelet(-eks) service during configure hook

This `snapctl restart` call was introduced in commit 6c89724 along with a number of other changes to fix LP:2012689. The restart call was added to align with behavior and examples from snapcraft documentation, but was not a core part of the fix.

As a consequence, every call to `snap set` now causes kubelet to start or restart, even if it was not running before. This created a new race condition in EKS images (LP:2023284) in which kubelet can start and register with Kubernetes before it is fully configured, leading user-specified options like --register-with-taints to be ignored.

To fix this, we can remove the `snapctl restart` call from the configure hook and revert to the old behavior where `snap start` or `snap restart` must be called explicitly after `snap set`. This should resolve the race condition for LP:2023284 while still preserving the most important parts of 6c89724.

To post a comment you must log in.
Revision history for this message
Kevin W Monroe (kwmonroe) wrote :

yup, +1. the previous 4s restart delay and atomic args from lp:2012689 are maintained, while allowing for multiple 'snap sets' before start/restart.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/snapcraft.yaml.in b/snapcraft.yaml.in
2index 393b80e..98cec62 100644
3--- a/snapcraft.yaml.in
4+++ b/snapcraft.yaml.in
5@@ -191,7 +191,6 @@ parts:
6 # can't finish generating the configure hook until now, after args have
7 # been added
8 echo 'mv "$SNAP_DATA/args.tmp" "$SNAP_DATA/args"' >> meta/hooks/configure
9- echo 'snapctl restart "$SNAP_NAME.daemon"' >> meta/hooks/configure
10
11 snapcraftctl build
12

Subscribers

People subscribed via source and target branches

to all changes: