Skip to content

Commit a49e803

Browse files
fix: argocd fullname template; feat: add sources-server and event-reporter versions to codefresh-cm ConfigMap (#430)
1 parent 03e0a98 commit a49e803

File tree

3 files changed

+40
-5
lines changed

3 files changed

+40
-5
lines changed

charts/gitops-runtime/templates/_helpers.tpl

+10-5
Original file line numberDiff line numberDiff line change
@@ -77,15 +77,15 @@ Determine argocd server service name. Must be called with chart root context
7777
*/}}
7878
{{- define "codefresh-gitops-runtime.argocd.server.servicename" -}}
7979
{{/* For now use template from ArgoCD chart until better approach */}}
80-
{{- template "argo-cd.server.fullname" (dict "Values" (get .Values "argo-cd")) }}
80+
{{- template "argo-cd.server.fullname" (dict "Values" (get .Values "argo-cd") "Release" .Release ) }}
8181
{{- end }}
8282

8383
{{/*
8484
Determine argocd redis service name. Must be called with chart root context
8585
*/}}
8686
{{- define "codefresh-gitops-runtime.argocd.redis.servicename" -}}
8787
{{/* For now use template from ArgoCD chart until better approach */}}
88-
{{- template "argo-cd.redis.fullname" (dict "Values" (get .Values "argo-cd")) }}
88+
{{- template "argo-cd.redis.fullname" (dict "Values" (get .Values "argo-cd") "Release" .Release ) }}
8989
{{- end }}
9090

9191
{{/*
@@ -94,7 +94,7 @@ Determine argocd repo server service name. Must be called with chart root contex
9494
{{- define "codefresh-gitops-runtime.argocd.reposerver.servicename" -}}
9595
{{/* For now use template from ArgoCD chart until better approach */}}
9696
{{- if and (index .Subcharts "argo-cd") }}
97-
{{- template "argo-cd.repoServer.fullname" (dict "Values" (get .Values "argo-cd")) }}
97+
{{- template "argo-cd.repoServer.fullname" (dict "Values" (get .Values "argo-cd") "Release" .Release ) }}
9898
{{- else }}
9999
{{- $repoServer := index .Values "global" "external-argo-cd" "repoServer" }}
100100
{{- $svc := required "ArgoCD is not enabled and .Values.global.external-argo-cd.repoServer.svc is not set" $repoServer.svc }}
@@ -142,7 +142,7 @@ Determine argocd servicename. Must be called with chart root context
142142
*/}}
143143
{{- define "codefresh-gitops-runtime.argocd.appcontroller.serviceAccountName" -}}
144144
{{/* For now use template from ArgoCD chart until better approach */}}
145-
{{- template "argo-cd.controllerServiceAccountName" (dict "Values" (get .Values "argo-cd")) }}
145+
{{- template "argo-cd.controllerServiceAccountName" (dict "Values" (get .Values "argo-cd") "Release" .Release ) }}
146146
{{- end }}
147147

148148
{{/*
@@ -430,7 +430,8 @@ Output comma separated list of installed runtime components
430430
{{- $sealedSecrets := dict "name" "sealed-secrets" "version" (get .Subcharts "sealed-secrets").Chart.AppVersion }}
431431
{{- $internalRouter := dict "name" "internal-router" "version" .Chart.AppVersion }}
432432
{{- $appProxy := dict "name" "app-proxy" "version" (index (get .Values "app-proxy") "image" "tag") }}
433-
{{- $comptList := list $argoEvents $appProxy $sealedSecrets $internalRouter}}
433+
{{- $sourcesServer := dict "name" "sources-server" "version" (get .Subcharts "cf-argocd-extras").Chart.AppVersion }}
434+
{{- $comptList := list $argoEvents $appProxy $sealedSecrets $internalRouter $sourcesServer }}
434435
{{- if and (index .Values "argo-cd" "enabled") }}
435436
{{- $argoCD := dict "name" "argocd" "version" (get .Subcharts "argo-cd").Chart.AppVersion }}
436437
{{- $comptList = append $comptList $argoCD }}
@@ -455,6 +456,10 @@ Output comma separated list of installed runtime components
455456
{{- $gitopsOperator := dict "name" "gitops-operator" "version" (get .Subcharts "gitops-operator").Chart.AppVersion }}
456457
{{- $comptList = append $comptList $gitopsOperator }}
457458
{{- end }}
459+
{{- if not (index .Values "argo-cd" "enabled") }}
460+
{{- $eventReporter := dict "name" "event-reporter" "version" (get .Subcharts "cf-argocd-extras").Chart.AppVersion }}
461+
{{- $comptList = append $comptList $eventReporter }}
462+
{{- end }}
458463
{{- $comptList | toYaml }}
459464
{{- end }}
460465

charts/gitops-runtime/tests/cf-argocd-extras_test.yaml

+16
Original file line numberDiff line numberDiff line change
@@ -109,3 +109,19 @@ tests:
109109
kind: Deployment
110110
apiVersion: apps/v1
111111
name: sources-server
112+
113+
- it: Sources-Server ConfigMap should have valid redis-ha url
114+
template: sources-server.yaml
115+
documentSelector:
116+
path: kind
117+
value: ConfigMap
118+
values:
119+
- ./values/mandatory-values-ingress.yaml
120+
set:
121+
argo-cd:
122+
redis-ha:
123+
enabled: true
124+
asserts:
125+
- equal:
126+
path: data["redis.server"]
127+
value: RELEASE-NAME-redis-ha-haproxy:6379

charts/gitops-runtime/tests/external_argocd_test.yaml

+14
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ templates:
88
- charts/gitops-operator/*
99
- charts/cf-argocd-extras/*
1010
- app-proxy/external-argocd-token.yaml
11+
- codefresh-cm.yaml
1112
tests:
1213
- it: app-proxy ConfigMap should have valid ArgoCd URL
1314
values:
@@ -727,6 +728,19 @@ tests:
727728
- isNotNullOrEmpty:
728729
path: stringData.token
729730

731+
- it: codefresh-cm ConfigMap should have event-reporter and sources-server
732+
template: codefresh-cm.yaml
733+
values:
734+
- ./values/mandatory-values-ingress.yaml
735+
- ./values/external-argocd-values.yaml
736+
asserts:
737+
- matchRegex:
738+
path: data.components
739+
pattern: "name: event-reporter"
740+
- matchRegex:
741+
path: data.components
742+
pattern: "name: sources-server"
743+
730744
# TO-DO: fix these tests!
731745

732746
# - it: should require ArgoCd token if auth.type=token is set and no token is provided

0 commit comments

Comments
 (0)