-
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#18402 from jack-w-shaw/JUJU-6869_RI_ports_proper
juju#18402 At the time, remove the unit_endpoint table. This table wasn't providing us with anything but pain. Instead, attach the foreign keys (unit and charm_relation) directly to the port range This then required a fairly substantial refactor of the state layer. Introducing RI from ports to relation resulted in an additional complexity with the wildcard endpoint, as this does not have a corresponding charm relation. I have dealt with this by using the null value. So a null value for relation_uuid represents the wildcard endpoint. This turned out to be a fairly natural solution. This refactor also meant that the watcher now emits unit uuids, rather than unit_endpoint uuids. This meant the watcher code needed a refactor/simplification as well. ## QA steps Download a charm and reconfigure it's relations ``` $ mkdir ubuntu-lite $ cd ubuntu-lite $ juju download ubuntu-lite $ unzip * [edit metadata.yaml such that] $ cat metadata.yaml ... provides: foo: interface: foo bar: interface: bar baz: interface: baz ... $ zip -r ubunty-lite.charm . ``` Bootstrap ``` $ juju bootstrap lxd lxd $ juju add-model m $ juju show-model m ... model-uuid: 1fad9711-72de-4479-8f9a-939808932230 ... $ juju deploy ./ubuntu-lite.charm ``` Run tests ``` $ juju exec --unit ubuntu-lite/0 "open-port --endpoint foo 1000/tcp" $ juju sql 1fad9711-72de-4479-8f9a-939808932230 > SELECT prdesc FROM port_range uuid protocol_id from_port to_port relation_uuid unit_uuid ff980f34-4943-47a6-8499-a33d19117cc8 1 1000 1000 43748109-9769-4018-8443-c7abd8728dfa 57921041-0f1e-44fb-83af-cc5a70c1050a $ juju exec --unit ubuntu-lite/0 "open-port --endpoints bar 1000/tcp" $ juju sql 1fad9711-72de-4479-8f9a-939808932230 > SELECT prdesc FROM port_range uuid protocol_id from_port to_port relation_uuid unit_uuid ff980f34-4943-47a6-8499-a33d19117cc8 1 1000 1000 43748109-9769-4018-8443-c7abd8728dfa 57921041-0f1e-44fb-83af-cc5a70c1050a 96f38b5a-32ec-4df8-88dc-599355fe4254 1 1000 1000 af92f025-5f77-4d9a-8627-416d93090cfc 57921041-0f1e-44fb-83af-cc5a70c1050a $ juju exec --unit ubuntu-lite/0 "open-port 1000/tcp" $ juju sql 1fad9711-72de-4479-8f9a-939808932230 > SELECT prdesc FROM port_range uuid protocol_id from_port to_port relation_uuid unit_uuid 6a89d03b-4da8-41ee-8b00-6861900a8121 1 1000 1000 <nil> 57921041-0f1e-44fb-83af-cc5a70c1050a ``` ### Test watchers IAAS ``` $ juju bootstrap aws aws $ juju add-model m $ juju deploy ubuntu $ juju expose ubuntu $ juju exec --unit ubuntu/0 open-port 1000/tcp $ juju debug-log -m controller .... machine-0: 11:41:43 INFO juju.provider.ec2 opened ports in security group juju-7df12cac-717b-424a-8b27-153d5e7bc8e2-0: [1000/tcp from 0.0.0.0/0,::/0] ``` CAAS ``` $ make microk8s-operator-update $ juju bootstrap microk8s mk8s $ juju add-model m $ juju model-config workload-storage="microk8s-hostpath" $ juju exec --unit hello-kubecon/0 open-port 1000/tcp $ microk8s.kubectl get -n m services NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE hello-kubecon ClusterIP 10.152.183.69 <none> 1000/TCP 90s ```
- Loading branch information
Showing
19 changed files
with
273 additions
and
329 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
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
Oops, something went wrong.