-
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.
Merge pull request juju#18749 from jack-w-shaw/JUJU-7406_remove_RunAt…
…omic_CreateApplication juju#18749 The application domain was constructed making liberal use of RunAtomic. But we have since decided that this was an anti-pattern, so it should be removed. Re-write a few methods to not be atomic. Starting with CreateApplication, but spilling over into a few others. This was not a trivial lift-and-switch for in a few ways. Particularly of note: 1. CreateApplication now has a multi-variadic parameter of AddUnitParams. This allows us to create an application and add units within the same transaction. A large number of instances of RunAtomic were doing exactly that. 2. InsertCAASUnit was created. The service method RegisterCAASUnit used to call InsertUnit in it's RunAtomic body. However, this body was very complex. So I have added a single method, InsertCAASUnit, on the state layer which now contains all this complexity. 3. Some params/args structs were moved from /domain/application/service up a level to `/domain/application`. This is because without RunAtomic these structs needed to simply be carried down through service to state 4. Some methods like `SetUnitAgentStatus` have been given the suffix `Atomic`. This is to distinguish them from non-atomic copies. The domain is quite tangled and I had to cut changes off somewhere. As a flyby, I have also converted over a large number of errors.Annotate to errors.Errorf, and renamed an `internalerrors` package import to `errors` ## QA steps Juju 4 seems to currently be broken on main (i.e. independently of this), so we can only test bootstrap for the CAAS changes. ``` $ make microk8s-operator-update $ juju bootstrap microk8s mk8s ``` ``` $ juju bootstrap lxd lxd $ juju add-model m $ juju deploy ubuntu $ juju add-unit ubuntu $ juju status ``` ## Links [JUJU-7406](https://warthogs.atlassian.net/browse/JUJU-7406) [JUJU-7406]: https://warthogs.atlassian.net/browse/JUJU-7406?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ
- Loading branch information
Showing
18 changed files
with
1,403 additions
and
1,113 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
Large diffs are not rendered by default.
Oops, something went wrong.
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.