Skip to content
Snippets Groups Projects
Commit 4a15683d authored by Maxim Ivanov's avatar Maxim Ivanov
Browse files

Do not error if no $._config.prometheus.rules are set

parent 7ca0a023
No related branches found
No related tags found
No related merge requests found
...@@ -40,7 +40,7 @@ local k = import 'ksonnet/ksonnet.beta.3/k.libsonnet'; ...@@ -40,7 +40,7 @@ local k = import 'ksonnet/ksonnet.beta.3/k.libsonnet';
service.new('prometheus-' + $._config.prometheus.name, { app: 'prometheus', prometheus: $._config.prometheus.name }, prometheusPort) + service.new('prometheus-' + $._config.prometheus.name, { app: 'prometheus', prometheus: $._config.prometheus.name }, prometheusPort) +
service.mixin.metadata.withNamespace($._config.namespace) + service.mixin.metadata.withNamespace($._config.namespace) +
service.mixin.metadata.withLabels({ prometheus: $._config.prometheus.name }), service.mixin.metadata.withLabels({ prometheus: $._config.prometheus.name }),
rules: [if $._config.prometheus.rules != null and $._config.prometheus.rules != {} then "rules"]:
{ {
apiVersion: 'monitoring.coreos.com/v1', apiVersion: 'monitoring.coreos.com/v1',
kind: 'PrometheusRule', kind: 'PrometheusRule',
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment