Skip to content

Commit

Permalink
Only do service mon when enabled
Browse files Browse the repository at this point in the history
  • Loading branch information
henrywhitaker3 committed Nov 24, 2023
1 parent fdfe815 commit 922f381
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion chart/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 2 additions & 0 deletions chart/templates/servicemonitor.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{{- if .Values.metrics.enabled }}
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
Expand All @@ -17,3 +18,4 @@ spec:
selector:
matchLabels:
{{- include "generic.selectorLabels" . | nindent 6 }}
{{- end }}
7 changes: 7 additions & 0 deletions chart/tests/servicemonitor_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 922f381

Please sign in to comment.