Skip to content

Commit

Permalink
Fix ServiceMonitor selector (#72)
Browse files Browse the repository at this point in the history
* Use helpers for ServiceMonitor labels

This makes them the same as for all other resources.

* Fix ServiceMonitor selector

The selector in ServiceMonitor had different labels hardcoded than the
one currently set by the Chart. This fixes it by using the
selectorLabels helper which is also used for the service.

* Chart version bump
  • Loading branch information
LittleFox94 authored Dec 2, 2021
1 parent 56cd20e commit 8d84f71
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
2 changes: 1 addition & 1 deletion helm/oauth2-proxy/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: oauth2-proxy
version: 5.0.5
version: 5.0.6
apiVersion: v2
appVersion: 7.2.0
home: https://oauth2-proxy.github.io/oauth2-proxy/
Expand Down
9 changes: 3 additions & 6 deletions helm/oauth2-proxy/templates/servicemonitor.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,17 @@ metadata:
namespace: {{ .Release.Namespace | quote }}
{{- end }}
labels:
app: {{ template "oauth2-proxy.name" . }}
chart: {{ template "oauth2-proxy.chart" . }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
prometheus: {{ .Values.metrics.servicemonitor.prometheusInstance }}
app: {{ template "oauth2-proxy.name" . }}
{{- include "oauth2-proxy.labels" . | indent 4 }}
{{- if .Values.metrics.servicemonitor.labels }}
{{ toYaml .Values.metrics.servicemonitor.labels | indent 4}}
{{- end }}
spec:
jobLabel: {{ template "oauth2-proxy.fullname" . }}
selector:
matchLabels:
app: {{ template "oauth2-proxy.name" . }}
release: {{ .Release.Name }}
{{- include "oauth2-proxy.selectorLabels" . | indent 6 }}
namespaceSelector:
matchNames:
- {{ .Release.Namespace }}
Expand Down

0 comments on commit 8d84f71

Please sign in to comment.