-
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#18459 from nvinuesa/fix-modelmanager-machines
juju#18459 Before this patch, any calls to MachineModelInfo() (located in apiserver/common) would have actually be returning info from the controller model machines. This was clearly reproducible if you had a model with 2 machines (and a no-ha controller), then a call to `juju show-model` would return with an error stating that machine "1" wasn't found. Another way of reproducing was to migrate that model. The fix is to inject the correct MachineService on the modelmanager facade. <!-- 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. --> ## QA steps Calls to `show-model` and `migrate` should work fine: ``` $ juju bootstrap lxd dst $ juju bootstrap lxd src $ juju add-model m $ juju add-machine $ juju add-machine $ juju show-model m: name: admin/m short-name: m model-uuid: 8d208308-f412-451e-8605-5899d621d8ed model-type: iaas controller-uuid: b3867b85-1284-4524-8ca4-13c50e9de91f controller-name: src is-controller: false owner: admin cloud: localhost region: localhost type: lxd life: alive status: current: available since: 6 seconds ago users: admin: display-name: admin access: admin last-connection: 11 seconds ago machines: "0": cores: 0 "1": cores: 0 secret-backends: internal: num-secrets: 0 status: active agent-version: 4.0-beta5.1 credential: name: localhost owner: admin cloud: localhost validity-check: valid supported-features: - name: juju description: the version of Juju used by the model version: 4.0-beta5.1 $ juju migrate m dst $ juju switch dst:m $ juju show-model m: name: admin/m short-name: m model-uuid: 8d208308-f412-451e-8605-5899d621d8ed model-type: iaas controller-uuid: b3867b85-1284-4524-8ca4-13c50e9de91f controller-name: dst is-controller: false owner: admin cloud: localhost region: localhost type: lxd life: alive status: current: available since: 6 seconds ago users: admin: display-name: admin access: admin last-connection: 11 seconds ago machines: "0": cores: 0 "1": cores: 0 secret-backends: internal: num-secrets: 0 status: active agent-version: 4.0-beta5.1 credential: name: localhost owner: admin cloud: localhost validity-check: valid supported-features: - name: juju description: the version of Juju used by the model version: 4.0-beta5.1 ``` ## Documentation changes <!-- How it affects user workflow (CLI or API). --> ## Links <!-- Link to all relevant specification, documentation, bug, issue or JIRA card. --> **Launchpad bug:** https://bugs.launchpad.net/juju/+bug/ **Jira card:** JUJU-
- Loading branch information
Showing
5 changed files
with
71 additions
and
1 deletion.
There are no files selected for viewing
38 changes: 38 additions & 0 deletions
38
apiserver/facades/client/modelmanager/mocks/service_mock.go
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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
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