Skip to content

Commit

Permalink
Service Monitor: Reorder namespace selector.
Browse files Browse the repository at this point in the history
  • Loading branch information
Gacko authored and k8s-infra-cherrypick-robot committed Oct 29, 2024
1 parent 9b59df5 commit 516b037
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions charts/ingress-nginx/templates/controller-servicemonitor.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,13 @@ metadata:
annotations: {{ toYaml .Values.controller.metrics.serviceMonitor.annotations | nindent 4 }}
{{- end }}
spec:
{{- if .Values.controller.metrics.serviceMonitor.namespaceSelector }}
namespaceSelector: {{ toYaml .Values.controller.metrics.serviceMonitor.namespaceSelector | nindent 4 }}
{{- else }}
namespaceSelector:
matchNames:
- {{ include "ingress-nginx.namespace" . }}
{{- end }}
selector:
matchLabels:
{{- include "ingress-nginx.selectorLabels" . | nindent 6 }}
Expand All @@ -37,13 +44,6 @@ spec:
{{- if .Values.controller.metrics.serviceMonitor.jobLabel }}
jobLabel: {{ .Values.controller.metrics.serviceMonitor.jobLabel | quote }}
{{- end }}
{{- if .Values.controller.metrics.serviceMonitor.namespaceSelector }}
namespaceSelector: {{ toYaml .Values.controller.metrics.serviceMonitor.namespaceSelector | nindent 4 }}
{{- else }}
namespaceSelector:
matchNames:
- {{ include "ingress-nginx.namespace" . }}
{{- end }}
{{- if .Values.controller.metrics.serviceMonitor.targetLabels }}
targetLabels: {{ toYaml .Values.controller.metrics.serviceMonitor.targetLabels | nindent 2 }}
{{- end }}
Expand Down

0 comments on commit 516b037

Please sign in to comment.