From 499010d1bddbd98424155a992487ba8d552ab5dd Mon Sep 17 00:00:00 2001 From: Ilia Medvedev Date: Sat, 10 Aug 2024 09:30:14 +0300 Subject: [PATCH 1/5] 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 From 15eef65b28fcd46034900882a5f0859fc9442e1f Mon Sep 17 00:00:00 2001 From: Ilia Medvedev Date: Sat, 10 Aug 2024 09:31:02 +0300 Subject: [PATCH 2/5] set application server and repo server address from values for event reporter --- charts/argo-cd/Chart.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charts/argo-cd/Chart.yaml b/charts/argo-cd/Chart.yaml index d56c55cd..b40905ea 100644 --- a/charts/argo-cd/Chart.yaml +++ b/charts/argo-cd/Chart.yaml @@ -3,7 +3,7 @@ appVersion: v2.11-2024.7.30-a31bf96bb kubeVersion: ">=1.23.0-0" description: A Helm chart for Argo CD, a declarative, GitOps continuous delivery tool for Kubernetes. name: argo-cd -version: 6.11.1-5-cap-2.11-2024.7.30-a31bf96bb +version: 6.11.1-6-cap-2.11-2024.7.30-a31bf96bb home: https://github.com/argoproj/argo-helm icon: https://argo-cd.readthedocs.io/en/stable/assets/logo.png sources: From d27db96baf9eb743313ccc0b255f8ce678696884 Mon Sep 17 00:00:00 2001 From: Ilia Medvedev Date: Sat, 10 Aug 2024 09:40:23 +0300 Subject: [PATCH 3/5] set application server and repo server address from values for event reporter --- charts/argo-cd/templates/_helpers.tpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charts/argo-cd/templates/_helpers.tpl b/charts/argo-cd/templates/_helpers.tpl index b4d3cb18..392cc00e 100644 --- a/charts/argo-cd/templates/_helpers.tpl +++ b/charts/argo-cd/templates/_helpers.tpl @@ -264,7 +264,7 @@ Create the name of the Argo CD server service account to use {{- end -}} {{/* -Helper template to set repo server url in event reporter +Helper template to set argocd server url in event reporter */}} {{- define "argo-cd.eventReporter.argocd-server-adress" -}} {{- $port := .Values.server.service.servicePortHttps }} From 1937bd112b139436a9f0e325ce2893b2d42a120e Mon Sep 17 00:00:00 2001 From: Ilia Medvedev Date: Sat, 10 Aug 2024 10:54:07 +0300 Subject: [PATCH 4/5] not required for repo-server --- charts/argo-cd/templates/_helpers.tpl | 8 -------- charts/argo-cd/templates/event-reporter/statefulset.yaml | 2 -- 2 files changed, 10 deletions(-) diff --git a/charts/argo-cd/templates/_helpers.tpl b/charts/argo-cd/templates/_helpers.tpl index 392cc00e..437ce143 100644 --- a/charts/argo-cd/templates/_helpers.tpl +++ b/charts/argo-cd/templates/_helpers.tpl @@ -274,11 +274,3 @@ Helper template to set argocd server url in event reporter {{- 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 854786fe..f51cb53b 100644 --- a/charts/argo-cd/templates/event-reporter/statefulset.yaml +++ b/charts/argo-cd/templates/event-reporter/statefulset.yaml @@ -73,8 +73,6 @@ spec: {{- 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 From 7cec851f87418eaa4364a52dec1a07efa4c835de Mon Sep 17 00:00:00 2001 From: Ilia Medvedev Date: Sat, 10 Aug 2024 14:59:09 +0300 Subject: [PATCH 5/5] remove unused variable --- charts/argo-cd/templates/_helpers.tpl | 1 - 1 file changed, 1 deletion(-) diff --git a/charts/argo-cd/templates/_helpers.tpl b/charts/argo-cd/templates/_helpers.tpl index 437ce143..cc2910b5 100644 --- a/charts/argo-cd/templates/_helpers.tpl +++ b/charts/argo-cd/templates/_helpers.tpl @@ -270,7 +270,6 @@ Helper template to set argocd server url in event reporter {{- $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 -}}