Skip to content

Commit

Permalink
Merge pull request #217 from appuio/fix/prepare-for-gojsonnet
Browse files Browse the repository at this point in the history
Make hidden `runbook_url` annotations visible
  • Loading branch information
simu authored Nov 1, 2024
2 parents 82ec34c + cba2b9e commit 6deb260
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions component/rules.jsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -223,9 +223,18 @@ local patchRules = {
function(group)
group {
rules: std.map(
function(rule) alertpatching.patchRule(rule, rulePatches, false) {
expr: patchExpr(super.expr),
},
function(rule)
alertpatching.patchRule(rule, rulePatches, false) {
// NOTE(sg): Make runbook_url annotation visible so we can
// always patch it. This is necessary because some upstream
// Jsonnet hides the annotation with `runbook_url::` for
// alerts where they don't want to set the annotation.
annotations+:
if std.objectHasAll(rule.annotations, 'runbook_url') then {
runbook_url::: super.runbook_url,
} else {},
expr: patchExpr(super.expr),
} + { annotations: std.prune(super.annotations) },
group.rules
),
},
Expand Down

0 comments on commit 6deb260

Please sign in to comment.