Skip to content

Commit

Permalink
Merge pull request #195 from appuio/fix/alertmanager-config
Browse files Browse the repository at this point in the history
Only use auto-discovery Alertmanager config when the feature is enabled
  • Loading branch information
simu authored Mar 28, 2024
2 parents 735dbbb + cb4e1e5 commit a11c106
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion component/main.jsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,15 @@ local customRules =
namespace: ns,
},
stringData: {
'alertmanager.yaml': if params.alertManagerAutoDiscovery.enabled then std.manifestYamlDoc(alertDiscovery.alertmanagerConfig) else alertDiscovery.alertmanagerConfig,
'alertmanager.yaml': std.manifestYamlDoc(
if params.alertManagerAutoDiscovery.enabled then
alertDiscovery.alertmanagerConfig
else
// We prune the user-provided config in the alert-discovery
// implementation. To avoid surprises, we explicitly prune the
// user-provided config here, if discovery is disabled.
std.prune(params.alertManagerConfig)
),
},
},
[if params.alertManagerAutoDiscovery.enabled && params.alertManagerAutoDiscovery.debug_config_map then '99_discovery_debug_cm']: alertDiscovery.debugConfigMap,
Expand Down

0 comments on commit a11c106

Please sign in to comment.