diff --git a/chart/Chart.yaml b/chart/Chart.yaml index 9d292df..db8f9b9 100644 --- a/chart/Chart.yaml +++ b/chart/Chart.yaml @@ -13,7 +13,7 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 1.3.1 +version: 1.3.2 # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. Versions are not expected to # follow Semantic Versioning. They should reflect the version the application is using. diff --git a/chart/templates/servicemonitor.yaml b/chart/templates/servicemonitor.yaml index c6d15ac..f34373e 100644 --- a/chart/templates/servicemonitor.yaml +++ b/chart/templates/servicemonitor.yaml @@ -1,3 +1,4 @@ +{{- if .Values.metrics.enabled }} apiVersion: monitoring.coreos.com/v1 kind: ServiceMonitor metadata: @@ -17,3 +18,4 @@ spec: selector: matchLabels: {{- include "generic.selectorLabels" . | nindent 6 }} +{{- end }} \ No newline at end of file diff --git a/chart/tests/servicemonitor_test.yaml b/chart/tests/servicemonitor_test.yaml index cada484..62f6a0b 100644 --- a/chart/tests/servicemonitor_test.yaml +++ b/chart/tests/servicemonitor_test.yaml @@ -4,6 +4,13 @@ templates: - servicemonitor.yaml tests: + - it: doesn't create when using default values + set: + metrics.enabled: false + asserts: + - hasDocuments: + count: 0 + - it: should create when using default values set: metrics.enabled: true