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 14 forks source link

Remove unnecessary usage of `StoredState` to track exporter installation status #201

Closed dashmage closed 2 months ago

dashmage commented 4 months ago

Currently we use StoredState in the charm to track whether the exporter has been installed. But this is unnecessary as we could just use Path.exists to check whether the relevant files (/etc/systemd/system/hardware-exporter/.service and /etc/hardware-exporter-config.yaml) exist.

Limitations of StoredState

dashmage commented 2 months ago

As part of this PR to add smartctl exporter support for the charm, we are removing the usage of StoredState to track whether an exporter has been installed.