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

Improve dataflow when rendering config file. #178

Closed chanchiwai-ray closed 4 months ago

chanchiwai-ray commented 4 months ago

Currently, service.ExporterTemplate.render_config determine REDFISH_ENABLE (jinja2) variable by get_hw_tool_white_list, but the same information is also retrieved in charm.HardwareObserverCharm._get_redfish_creds via bmc_hw_verifier. If the two does not match (e.g. bmc_hw_verifier determines it redfish is not available but get_hw_tool_white_list determines that redfish is available), it will cause issue mentioned in #130.

This PR tries to remove the possibility that the two information is inconsistent by relying on single source of truth. Note, it might not solve #130, since the root cause is not clear, and it's not reproducible from my environement.