The Configuration trait is implemented for Role config structs, to derive product configuration settings from the Role config, this has been in place already for a while.
It turns out, a lot of role config settings need to be set based on information that is only resolved later, as the reconcile function is resolving discovery ConfigMaps or AuthenticationClasses. This has led to role configuration being set in the controller with switch statements like in the Druid Operator.
This is not great, because it leads to inconsistencies across Operators, but worse it breaks the Override functionality for any setting that is set here. Overrides are applied by the framework, inside the transform_all_roles_to_config function. This function returns a value of this type
Any changes that need to made to the configuration now have to be made on this structure. This is very painful, and every Operator does it differently. it involves parsing role names back into enums, looking up stuff with enum switches etc. etc.
This ticket was triggered by a bug that surfaced in the Druid Operator.
The
Configuration
trait is implemented for Role config structs, to derive product configuration settings from the Role config, this has been in place already for a while.It turns out, a lot of role config settings need to be set based on information that is only resolved later, as the reconcile function is resolving discovery ConfigMaps or AuthenticationClasses. This has led to role configuration being set in the controller with switch statements like in the Druid Operator.
This is not great, because it leads to inconsistencies across Operators, but worse it breaks the Override functionality for any setting that is set here. Overrides are applied by the framework, inside the
transform_all_roles_to_config
function. This function returns a value of this typeAfter validating it, we get
Any changes that need to made to the configuration now have to be made on this structure. This is very painful, and every Operator does it differently. it involves parsing role names back into enums, looking up stuff with enum switches etc. etc.