The _on_config_changed event has a few issues that might cause unexpected behaviors in some corner cases:
The defer() function is called without a return follow immediately, which is not what defer suppose to do
When cos_agent relation is missing, the config changed event will not render the config file; even when the cos_agent relation is joined, the previous config changed event will not fire again. This cause a loss of config changed event when cos_agent relation is missing.
The
_on_config_changed
event has a few issues that might cause unexpected behaviors in some corner cases:defer()
function is called without areturn
follow immediately, which is not what defer suppose to do