flant / addon-operator

A system to manage additional components for Kubernetes cluster in a simple, consistent and automated way.
https://flant.github.io/addon-operator/
Apache License 2.0
483 stars 27 forks source link

some refactoring #450

Closed miklezzzz closed 7 months ago

miklezzzz commented 8 months ago

Overview

Some refactoring of the code related to registering a module (load/reload) so as to make it a bit more straightforward and unambiguous. Module registration/load leverages ConvergeModules (ReloadAllModules) functionality of the operator in case a new module has to be registered. *Converge-related code has been moved from addon_operator package to a dedicated converge package so that it could be used by module manager package.

What this PR does / why we need it

Besides some refactoring, this PR introduces another approach to module registration: if a new module is registered in enabled state, instead of reloading the operator we run ConvergeModules task that reloads all enabled modules so that their values are updated in accordance with the new configuration.

Special notes for your reviewer