diff --git a/charts/argo-cd/templates/_helpers.tpl b/charts/argo-cd/templates/_helpers.tpl index acc8c219..b4d3cb18 100644 --- a/charts/argo-cd/templates/_helpers.tpl +++ b/charts/argo-cd/templates/_helpers.tpl @@ -262,3 +262,23 @@ Create the name of the Argo CD server service account to use {{ default "default" .Values.eventReporter.serviceAccount.name }} {{- end -}} {{- end -}} + +{{/* +Helper template to set repo server url in event reporter +*/}} +{{- define "argo-cd.eventReporter.argocd-server-adress" -}} + {{- $port := .Values.server.service.servicePortHttps }} + {{- if (index .Values.configs.params "server.insecure") }} + {{- $port = .Values.server.service.servicePortHttp }} + {{- $protocol = "http"}} + {{- end }} + {{- printf "%s:%v" (include "argo-cd.server.fullname" .) $port }} +{{- end -}} + +{{/* +Helper template to set repo server url in event reporter +*/}} +{{- define "argo-cd.eventReporter.argocd-repo-server-adress" -}} + {{- $port := .Values.repoServer.service.port }} + {{- printf "%s:%v" (include "argo-cd.repoServer.fullname" .) $port }} +{{- end -}} diff --git a/charts/argo-cd/templates/event-reporter/statefulset.yaml b/charts/argo-cd/templates/event-reporter/statefulset.yaml index 11bc9c01..854786fe 100644 --- a/charts/argo-cd/templates/event-reporter/statefulset.yaml +++ b/charts/argo-cd/templates/event-reporter/statefulset.yaml @@ -71,6 +71,10 @@ spec: {{- with (concat .Values.global.env .Values.eventReporter.env) }} {{- toYaml . | nindent 10 }} {{- end }} + - name: EVENT_REPORTER_APPLICATION_SERVER + value: {{ include "argo-cd.eventReporter.argocd-server-adress" . }} + - name: EVENT_REPORTER_REPO_SERVER + value: {{ include "argo-cd.eventReporter.argocd-repo-server-adress" . }} - name: EVENT_REPORTER_REPLICAS value: {{ .Values.eventReporter.replicas | quote }} - name: ARGOCD_APPLICATION_NAMESPACES