Merge pull request #1534 from junotx/k8s-rule-group

jsonnet: fix default empty groups for k8s PrometheusRule
This commit is contained in:
Arthur Silva Sens 2021-12-03 09:39:23 -03:00 committed by GitHub
commit f7c9de918c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -47,8 +47,8 @@ function(params) {
labels+: k8s._config.mixin.ruleLabels,
},
spec: {
local r = if std.objectHasAll(k8s.mixin, 'prometheusRules') then k8s.mixin.prometheusRules.groups else {},
local a = if std.objectHasAll(k8s.mixin, 'prometheusAlerts') then k8s.mixin.prometheusAlerts.groups else {},
local r = if std.objectHasAll(k8s.mixin, 'prometheusRules') then k8s.mixin.prometheusRules.groups else [],
local a = if std.objectHasAll(k8s.mixin, 'prometheusAlerts') then k8s.mixin.prometheusAlerts.groups else [],
groups: a + r,
},
},