forked from canonical/snapd
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
o/hookstate/ctlcmd: queue service commands if run from default-config…
…ure hook (canonical#13960) * o/hookstate/ctlcmd: queue service command if run from default-configure hook Queue "snapctl restart ..." and "snapctl start ..." commands to be run after default-configure similar to configure hook. This is to avoid a problem where the service doesn't see a new value if it uses "snapctl get ...", because it's still not commited by default-configure hook. Fixes: https://bugs.launchpad.net/snapd/+bug/2047949 Signed-off-by: Zeyad Gouda <[email protected]> * o/hookstate/ctlcmd: refactor TestQueuedCommands into two tests And add comments explaining tasks relative order. Signed-off-by: Zeyad Gouda <[email protected]> * o/hookstate/ctlcmd: fix typo in TestQueuedCommandsDefaultConfigureHook Signed-off-by: Zeyad Gouda <[email protected]> * o/hookstate/ctlcmd: inject default-configure hook commands after start-snap-services Signed-off-by: Zeyad Gouda <[email protected]> * o/hookstate/ctlcmd: fix queuing commands for default-configure hook Multiple snaps could be installed in a single transaction where all snap tasksets are in a single lane. The old simplistic approach of looking up the first "start-snap-services" fails when we have multiple tasks for multiple snaps in the same lane. A test is added to trigger this corner case, and the fix just checks the snap name associated with the "start-snap-services" tasks. Signed-off-by: Zeyad Gouda <[email protected]> * o/hookstate/ctlcmd: explain why configure hook is not tested for single transaction Signed-off-by: Zeyad Gouda <[email protected]> --------- Signed-off-by: Zeyad Gouda <[email protected]>
- Loading branch information
1 parent
5b632be
commit 4669c7c
Showing
3 changed files
with
270 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters