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

@ -2,7 +2,7 @@ apiVersion: v2
appVersion: v1.7.6
description: A Helm chart for Argo Events, the event-driven workflow automation framework
name: argo-events
version: 2.1.6
version: 2.2.0
home: https://github.com/argoproj/argo-helm
icon: https://argoproj.github.io/argo-events/assets/logo.png
keywords:
@ -16,4 +16,4 @@ maintainers:
annotations:
artifacthub.io/changes: |
- kind: fixed
description: fix toYaml function in deployment template for envFrom block
description: add namespace field for namespace scoped resources

View file

@ -2,6 +2,7 @@ apiVersion: v1
kind: ConfigMap
metadata:
name: {{ include "argo-events.controller.fullname" . }}
namespace: {{ .Release.Namespace | quote }}
labels:
{{- include "argo-events.labels" (dict "context" . "name" .Values.controller.name) | nindent 4 }}
data:

View file

@ -2,6 +2,7 @@ apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "argo-events.controller.fullname" . }}
namespace: {{ .Release.Namespace | quote }}
labels:
{{- include "argo-events.labels" (dict "context" . "component" .Values.controller.name "name" .Values.controller.name) | nindent 4 }}
app.kubernetes.io/version: {{ include "argo-events.controller_chart_version_label" . }}

View file

@ -3,6 +3,7 @@ apiVersion: {{ template "argo-events.pdb.apiVersion" . }}
kind: PodDisruptionBudget
metadata:
name: {{ template "argo-events.controller.fullname" . }}
namespace: {{ .Release.Namespace | quote }}
labels:
{{- include "argo-events.labels" (dict "context" . "component" .Values.controller.name "name" .Values.controller.name) | nindent 4 }}
{{- with .Values.controller.pdb.labels }}

View file

@ -3,6 +3,9 @@ apiVersion: rbac.authorization.k8s.io/v1
kind: {{ .Values.controller.rbac.namespaced | ternary "Role" "ClusterRole" }}
metadata:
name: {{ include "argo-events.controller.fullname" . }}
{{- if .Values.controller.rbac.namespaced }}
namespace: {{ .Release.Namespace | quote }}
{{- end }}
labels:
{{- include "argo-events.labels" (dict "context" . "component" .Values.controller.name "name" .Values.controller.name) | nindent 4 }}
rules:
@ -119,5 +122,5 @@ roleRef:
subjects:
- kind: ServiceAccount
name: {{ include "argo-events.controller.serviceAccountName" . }}
namespace: {{ .Release.Namespace }}
namespace: {{ .Release.Namespace | quote }}
{{- end }}

View file

@ -3,6 +3,7 @@ apiVersion: v1
kind: Service
metadata:
name: {{ template "argo-events.controller.fullname" . }}-metrics
namespace: {{ .Release.Namespace | quote }}
{{- with .Values.controller.metrics.service.annotations }}
annotations:
{{- range $key, $value := . }}

View file

@ -4,6 +4,7 @@ kind: ServiceAccount
automountServiceAccountToken: {{ .Values.controller.serviceAccount.automountServiceAccountToken }}
metadata:
name: {{ include "argo-events.controller.serviceAccountName" . }}
namespace: {{ .Release.Namespace | quote }}
{{- with .Values.controller.serviceAccount.annotations }}
annotations:
{{- range $key, $value := . }}

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 }}

View file

@ -12,5 +12,5 @@ roleRef:
subjects:
- kind: ServiceAccount
name: {{ include "argo-events.webhook.serviceAccountName" . }}
namespace: {{ .Release.Namespace }}
namespace: {{ .Release.Namespace | quote }}
{{- end }}

View file

@ -3,6 +3,7 @@ apiVersion: apps/v1
kind: Deployment
metadata:
name: events-webhook
namespace: {{ .Release.Namespace | quote }}
labels:
{{- include "argo-events.labels" (dict "context" . "component" .Values.webhook.name "name" .Values.webhook.name) | nindent 4 }}
app.kubernetes.io/version: {{ include "argo-events.webhook_chart_version_label" . }}

View file

@ -3,6 +3,7 @@ apiVersion: {{ template "argo-events.pdb.apiVersion" . }}
kind: PodDisruptionBudget
metadata:
name: {{ template "argo-events.webhook.fullname" . }}
namespace: {{ .Release.Namespace | quote }}
labels:
{{- include "argo-events.labels" (dict "context" . "component" .Values.webhook.name "name" .Values.webhook.name) | nindent 4 }}
{{- with .Values.webhook.pdb.labels }}

View file

@ -3,6 +3,7 @@ apiVersion: v1
kind: Service
metadata:
name: events-webhook
namespace: {{ .Release.Namespace | quote }}
labels:
{{- include "argo-events.labels" (dict "context" . "name" .Values.webhook.name) | nindent 4 }}
spec:

View file

@ -4,6 +4,7 @@ kind: ServiceAccount
automountServiceAccountToken: {{ .Values.webhook.serviceAccount.automountServiceAccountToken }}
metadata:
name: {{ include "argo-events.webhook.serviceAccountName" . }}
namespace: {{ .Release.Namespace | quote }}
{{- with .Values.webhook.serviceAccount.annotations }}
annotations:
{{- range $key, $value := . }}