-
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#16999 from Aflynn50/move-network-discovery-logic
juju#16999 <!-- Why this change is needed and what it does. --> The network discovery logic used by the machiner worker, the provisioner worker and the container broker was located in api/common. This is not a good place for it and means that api/common has dependencies on netlink which are not needed. The discovery logic is moved to core/network, and the return type of the primary function is changed from relying on a type in `params` because this created a cyclic dependency and it is the resposiblity of the call site translate to the serialisable type. ## 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 - [ ] [Integration tests](https://github.com/juju/juju/tree/main/tests), with comments saying what you're testing ## QA steps #### Unit tests ``` go test -check.v ./core/network/... go test -check.v ./worker/machiner/... go test -check.v ./worker/provisioner/... go test -check.v ./worker/containerbroker/... go test -check.v ./container/broker/... ``` #### Integration tests Bootstrap a manual machine and check that network discovery works: ``` lxc launch ubuntu:22.04 # Note down machine name and ip lxc list lxc exec <machine-name> bash <copy your local ~/.ssh/key.pub onto the machine in /home/ubuntu/.ssh/authorized_keys> # Bootstrap juju on the manual machine juju bootstrap manual/ubuntu@<ip> juju switch controller # Check that network-interfaces are listed (e.g. eth0) juju show-machine 0 ``` <!-- Describe steps to verify that the change works. --> ## Documentation changes <!-- How it affects user workflow (CLI or API). --> ## Links <!-- Link to all relevant specification, documentation, bug, issue or JIRA card. --> **Jira card:** JUJU-5482
- Loading branch information
Showing
14 changed files
with
98 additions
and
98 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
6 changes: 3 additions & 3 deletions
6
api/common/network_mock_test.go → core/network/discovery_mock_test.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
Oops, something went wrong.