From 499010d1bddbd98424155a992487ba8d552ab5dd Mon Sep 17 00:00:00 2001 From: Ilia Medvedev Date: Sat, 10 Aug 2024 09:30:14 +0300 Subject: [PATCH] set application server and repo server address from values for event reporter --- charts/argo-cd/templates/_helpers.tpl | 20 +++++++++++++++++++ .../templates/event-reporter/statefulset.yaml | 4 ++++ 2 files changed, 24 insertions(+) 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