canonical / magma-access-gateway-operator

Magma's 4G and 5G core, charmed!
Apache License 2.0
3 stars 2 forks source link

Bugfix: Handle reboot in the charm instead of the snap #10

Closed ghislainbourgeois closed 2 years ago

ghislainbourgeois commented 2 years ago

One thing not related to this PR - do we need the handler for config_changed event? We don't support upgrades, if Magma is already installed, _on_install, which is triggered by the config_changed exits right away and having both install and config_changed handlers may cause race condition during installation (i.e. if user starts the deployment without specifying interfaces and then updates the config).

We could defer the install event instead of using config_changed, the reason it is like this is that you can deploy the charm without a config, and the only thing that will unblock the installation is a config_changed. Only one hooks runs at a time, so the first hook that has the right config will run the installation. The other hooks will skip because the service will already be enabled in systemd.