-
Notifications
You must be signed in to change notification settings - Fork 587
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
o/snapstate: refactor Install functions to use a singular implementat…
…ion that operates on a Target (#13949) * snap: add method for checking if a revision is set to reduce double negatives in code * o/snapstate, o/hookstate: make mocked snapstate.EnforcedValidationSets follow correct pattern when returning no error * o/snapstate: add new function InstallTarget that operates a Target interfaces, which controls how snaps are found * o/snapstate: implement Install family of functions with InstallTarget InstallPathMany is omitted for now, since it is more of an update rather than an installation. * o/snapstate: update perquisites task handler to use new lane functionality in InstallWithDeviceContext * o/snapstate: doc comment fixes Co-authored-by: Miguel Pires <miguelpires94@gmail.com> * o/snapstate: add license header to target.go * o/snapstate: rename SnapstateOptions to Options * o/snapstate: rename interface parameter to better indicate use * o/snapstate: make laneGenerator a standalone function * o/snapstate: fix redundant error message by calling singleActionResultErr when only one result is expected * o/snapstate: doc comments on new target functions/types * o/snapstate: rename StoreSnap.Name to StoreSnap.InstanceName * o/snapstate: rename laneGenerator -> generateLane * o/snapstate: test for error when installing an already installed snap * o/snapstate: add test for invalid revision options * o/snapstate: remove awkward installed snaps param from Target interface * o/devicestate, o/snapstate: replace OptionInitializer with simpler boolean flag in Options that allows caller to skip seeded check * o/devicestate, o/snapstate: rename new types introduced in refactor * o/snapstate: rename InstallGoal.Install to InstallGoal.ToInstall * o/snapstate: introduce Options.RequireOneSnap flag to require that we are only installing one snap AND allow us to choose how to generate errors * o/snapstate: reduce number of exported fields/types related to InstallWithGroup * o/snapstate: make functions that create goals return interfaces rather than concrete types * o/snapstate: rename StoreGoal to StoreInstallGoal * o/snapstate: rename RequireOneSnap to ExpectOneSnap * o/snapstate: update doc commentsa on StoreInstallGoal and PathInstallGoal * snap, o/snapstate: remove snap.R.Set helper method * o/devicestate: replace unneeded param with empty string, which will default to SideInfo.RealName * o/snapstate: manually re-lock lock earlier, avoid golangci-lint error * o/snapstate: replace manually building SnapSetup with method on target * o/snapstate: add comments to storeInstallGoal fields and clarify behavior of StoreInstallGoal * o/snapstate: reword PathInstallGoal doc comment * o/snapstate: re-export the installGoal interface * o/snapstate: use slice inside of storeInstallGoal to maintain order of requested snap installs * o/devicestate: make sure to set channel when seeding system, and add a test for it --------- Co-authored-by: Miguel Pires <miguelpires94@gmail.com>
- Loading branch information
1 parent
5d73ed0
commit 6871ec3
Showing
17 changed files
with
879 additions
and
419 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
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
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
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
Oops, something went wrong.