canonical / istio-operators

Charmed Istio
2 stars 17 forks source link

Backport changes to implement CNI configuration #404

Closed DnPlas closed 3 months ago

DnPlas commented 3 months ago

The _cni_config_changed() method was not called correctly because of a typo, which led to the condition evaluating it to always be True, and running upgrades when they are not required. Calling correctly the method ensures the charm executes correct pieces of code. By doing this, the GenericCharmRuntimeError exception that gets raised on an error with CNI configuration must be re-raised when handling the reconcile.

Fixes #395

This commit enables the Istio CNI plugin by default in all new deployments of istio-pilot provided the required charm configuration is present; otherwise the control plane remains intact. It is also ensured that the required configurations are present when upgrading to future versions so the plugin is correctly installed on existing control planes (versions <1.17).

Fixes #356 Part of #351

This refactor uses the install method form the istioctl wrapper to install the control plane without calling subprocess directly in the charm code.

This commit also changes the unit tests and lints the code and tests to adapt to the recent refactor.

Part of #351