Skip to content

Commit

Permalink
Merge pull request juju#18435 from Aflynn50/use-watcher-registry-for-…
Browse files Browse the repository at this point in the history
…entity-watcher

juju#18435

The AgentEntityWatcher used the old facade.Resources approach to register its watchers. The Watch api call is going to be updated as part of other work so this is getting the facade ready for that.

<!-- 
The PR title should match: <type>(optional <scope>): <description>.

Please also ensure all commits in this PR comply with our conventional commits specification:
https://github.com/juju/juju/blob/main/doc/conventional-commits.md
-->

<!-- Why this change is needed and what it does. -->

## Checklist

<!-- If an item is not applicable, use `~strikethrough~`. -->

- [x] Code style: imports ordered, good names, simple structure, etc
- [x] Comments saying why design decisions were made
- [x] Go unit tests, with comments saying what you're testing
- [x] [doc.go](https://discourse.charmhub.io/t/readme-in-packages/451) added or updated in changed packages

## QA steps
Run the unit tests and smoke.
<!-- 

Describe steps to verify that the change works. 

If you're changing any of the facades, you need to ensure that you've tested
a model migration from 3.6 to 4.0 and from 4.0 to 4.0.

The following steps are a good starting point:

 1. Bootstrap a 3.6 controller and deploy a charm.

```sh
$ juju bootstrap lxd src36
$ juju add-model moveme1
$ juju deploy juju-qa-test
```

 2. Bootstrap a 4.0 controller with the changes and migrate the model.

```sh
$ juju bootstrap lxd dst40
$ juju migrate src36:moveme1 dst40
$ juju add-unit juju-qa-test
```

 3. Verify no errors exist in the model logs for the agents. If there are
 errors, this is a bug and should be fixed before merging. The fix can
 either be applied to the 4.0 branch (preferable) or the 3.6 branch, though
 that needs to be discussed with the team.

```sh
$ juju debug-log -m dst40:controller
$ juju debug-log -m dst40:moveme1
```

 4. We also need to test a model migration from 4.0 to 4.0.

```sh
$ juju bootstrap lxd src40
$ juju add-model moveme2
$ juju deploy juju-qa-test
```

```sh
$ juju migrate src40:moveme2 dst40
$ juju add-unit juju-qa-test
```

 5. Verify that there are no errors in the controller or model logs.

```sh
$ juju debug-log -m dst40:controller
$ juju debug-log -m dst40:moveme2
```

--
## Links

<!-- Link to all relevant specification, documentation, bug, issue or JIRA card. -->

**Jira card:** [JUJU-7104](https://warthogs.atlassian.net/browse/JUJU-7104)



[JUJU-7104]: https://warthogs.atlassian.net/browse/JUJU-7104?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ
  • Loading branch information
jujubot authored Nov 28, 2024
2 parents f575f4d + ec0aa2a commit 5987f3b
Show file tree
Hide file tree
Showing 42 changed files with 3,707 additions and 1,804 deletions.
2 changes: 0 additions & 2 deletions apiserver/common/leadership.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@ import (
"github.com/juju/juju/state"
)

//go:generate go run go.uber.org/mock/mockgen -typed -package mocks -destination mocks/leadership.go github.com/juju/juju/apiserver/common LeadershipPinningBackend,LeadershipMachine

// LeadershipMachine is an indirection for state.machine.
type LeadershipMachine interface {
ApplicationNames() ([]string, error)
Expand Down
119 changes: 0 additions & 119 deletions apiserver/common/mocks/block_mock.go

This file was deleted.

Loading

0 comments on commit 5987f3b

Please sign in to comment.