canonical / hardware-observer-operator

A charm to setup prometheus exporter for IPMI, RedFish and RAID devices from different vendors.
Apache License 2.0
7 stars 15 forks source link

Clean up logic in `_on_config_changed` event #215

Open chanchiwai-ray opened 6 months ago

chanchiwai-ray commented 6 months ago

The _on_config_changed event has a few issues that might cause unexpected behaviors in some corner cases:

  1. The defer() function is called without a return follow immediately, which is not what defer suppose to do
  2. 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.