fix default empty groups for k8s PrometheusRule

This commit is contained in:
junot 2021-12-03 14:08:59 +08:00
parent 5885e2a332
commit bd95a19cc3

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,
},
},