fix(argo-events): add namespace field for namespace scoped resources (#1959)

* fix(argo-events): add namespace field for namespace scoped resources
Signed-off-by: yu-croco <yu.croco@gmail.com>

* Apply suggestion from code review

Signed-off-by: Marco Kilchhofer <mkilchhofer@users.noreply.github.com>

---------

Signed-off-by: Marco Kilchhofer <mkilchhofer@users.noreply.github.com>
Co-authored-by: Marco Kilchhofer <mkilchhofer@users.noreply.github.com>
This commit is contained in:
Aikawa 2023-04-14 03:38:04 +09:00 committed by GitHub
parent 406e07b46b
commit 076cf82ddd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
13 changed files with 18 additions and 8 deletions

View file

@ -3,9 +3,7 @@ apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
name: {{ template "argo-events.controller.fullname" . }}
{{- with .Values.controller.metrics.serviceMonitor.namespace }}
namespace: {{ . }}
{{- end }}
namespace: {{ default .Release.Namespace .Values.controller.metrics.serviceMonitor.namespace | quote }}
labels:
{{- include "argo-events.labels" (dict "context" . "component" .Values.controller.name "name" .Values.controller.name) | nindent 4 }}
{{- with .Values.controller.metrics.serviceMonitor.selector }}
@ -31,7 +29,7 @@ spec:
{{- end }}
namespaceSelector:
matchNames:
- {{ .Release.Namespace }}
- {{ .Release.Namespace | quote }}
selector:
matchLabels:
{{- include "argo-events.selectorLabels" (dict "context" . "component" .Values.controller.name "name" (printf "%s-metrics" .Values.controller.name)) | nindent 6 }}