Merge ~mattyw/prometheus-charm:01-configure-rules into prometheus-charm:master
Status: | Merged |
---|---|
Merged at revision: | 166479c1c040ff5f0745cab1018bff5cf5ffd640 |
Proposed branch: | ~mattyw/prometheus-charm:01-configure-rules |
Merge into: | prometheus-charm:master |
Diff against target: |
39 lines (+2/-5) 1 file modified
reactive/prometheus.py (+2/-5) |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Jacek Nykis (community) | Approve | ||
Casey Marshall (community) | Approve | ||
Review via email: mp+330996@code.launchpad.net |
Commit message
prometheus.py: The configure_rules function needs to be called immediately, rather than scheduling for later, the rules for state execution are non deterministic, but we require this to be called before promtool validates them
Description of the change
This is a follow on from https:/
The change in this pr fixes a similar issue where deploying the charm with an initial config setting for custom-rules would cause and install hook error.
cat cfg.yaml
prometheus:
custom-rules: {}
$ juju deploy --config cfg.yaml cs:prometheus
This was because the configure_rules function (where the file is written) would not be called as the check_reconfig_
After examining the states it became clear that actually calling the function directly rather than setting states would be a much clearer way of executing this function in the right place, as state execution ordering is not defined in charms.reactive
LGTM