Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions application/templates/servicemonitor.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ spec:
selector:
matchLabels:
{{ include "application.labels" $ | indent 6 }}
{{- if .Values.service.additionalLabels }}
{{- toYaml .Values.service.additionalLabels | nindent 6 }}
{{- end }}
namespaceSelector:
matchNames:
- {{ include "application.namespace" . }}
Expand Down
2 changes: 2 additions & 0 deletions application/tests/__snapshot__/common_test.yaml.snap
Original file line number Diff line number Diff line change
Expand Up @@ -1824,8 +1824,10 @@ should match snapshot:
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/name: application
app.kubernetes.io/version: example-tag
expose: "true"
group: com.stakater.platform
helm.sh/chart: application-0.0.0
key: value
team: stakater
37: |
apiVersion: autoscaling.k8s.io/v1
Expand Down
18 changes: 18 additions & 0 deletions application/tests/servicemonitor_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,24 @@ tests:
path: metadata.labels.custom
value: label

- it: renders ServiceMonitor selector with service additionalLabels
set:
serviceMonitor:
enabled: true
endpoints:
- port: http
interval: 30s
service:
additionalLabels:
custom: label
capabilities:
apiVersions:
- "monitoring.coreos.com/v1"
asserts:
- equal:
path: spec.selector.matchLabels.custom
value: label

- it: renders ServiceMonitor with annotations
set:
serviceMonitor:
Expand Down