rules-repo config description incorrect

Bug #2018933 reported by Chris Johnston
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Prometheus2 charm
Fix Released
Undecided
Chris Johnston

Bug Description

  rules-repo:
    type: string
    description: |
        Git repository with custom rules. Rules have to be in *.rules files

This would indicate that any file that doesn't end in .rules would be ignored. In reality, it appears that .rules, .yaml, and .yml files are all considered valid:

    for root, dirs, filenames in os.walk(PATHS["external_rules_path"]):
        for filename in filenames:
            # Ignore files such as .launchpad.yaml and .yamllint.yaml
            if filename.startswith("."):
                continue
            match = re.match("^.*\.(yaml|yml|rules)$", filename) # NOQA W605
            if match:
                # Wildcard filename part to allow rule files to disappear
                rule_files.append("{}/*.{}".format(root, match.group(1)))
    return sorted(list(set(rule_files))) # dedup entries

Related branches

Changed in charm-prometheus2:
assignee: nobody → Chris Johnston (cjohnston)
status: New → Fix Committed
Ashley James (dashmage)
Changed in charm-prometheus2:
milestone: none → 23.07
Ashley James (dashmage)
Changed in charm-prometheus2:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.