diff --git a/charts/gitops-runtime/templates/_helpers.tpl b/charts/gitops-runtime/templates/_helpers.tpl index b3ee489d..2782b776 100644 --- a/charts/gitops-runtime/templates/_helpers.tpl +++ b/charts/gitops-runtime/templates/_helpers.tpl @@ -77,7 +77,7 @@ Determine argocd server service name. Must be called with chart root context */}} {{- define "codefresh-gitops-runtime.argocd.server.servicename" -}} {{/* For now use template from ArgoCD chart until better approach */}} -{{- template "argo-cd.server.fullname" (dict "Values" (get .Values "argo-cd")) }} +{{- template "argo-cd.server.fullname" (dict "Values" (get .Values "argo-cd") "Release" .Release ) }} {{- end }} {{/* @@ -85,7 +85,7 @@ Determine argocd redis service name. Must be called with chart root context */}} {{- define "codefresh-gitops-runtime.argocd.redis.servicename" -}} {{/* For now use template from ArgoCD chart until better approach */}} -{{- template "argo-cd.redis.fullname" (dict "Values" (get .Values "argo-cd")) }} +{{- template "argo-cd.redis.fullname" (dict "Values" (get .Values "argo-cd") "Release" .Release ) }} {{- end }} {{/* @@ -94,7 +94,7 @@ Determine argocd repo server service name. Must be called with chart root contex {{- define "codefresh-gitops-runtime.argocd.reposerver.servicename" -}} {{/* For now use template from ArgoCD chart until better approach */}} {{- if and (index .Subcharts "argo-cd") }} - {{- template "argo-cd.repoServer.fullname" (dict "Values" (get .Values "argo-cd")) }} + {{- template "argo-cd.repoServer.fullname" (dict "Values" (get .Values "argo-cd") "Release" .Release ) }} {{- else }} {{- $repoServer := index .Values "global" "external-argo-cd" "repoServer" }} {{- $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 */}} {{- define "codefresh-gitops-runtime.argocd.appcontroller.serviceAccountName" -}} {{/* For now use template from ArgoCD chart until better approach */}} -{{- template "argo-cd.controllerServiceAccountName" (dict "Values" (get .Values "argo-cd")) }} +{{- template "argo-cd.controllerServiceAccountName" (dict "Values" (get .Values "argo-cd") "Release" .Release ) }} {{- end }} {{/* @@ -430,7 +430,8 @@ Output comma separated list of installed runtime components {{- $sealedSecrets := dict "name" "sealed-secrets" "version" (get .Subcharts "sealed-secrets").Chart.AppVersion }} {{- $internalRouter := dict "name" "internal-router" "version" .Chart.AppVersion }} {{- $appProxy := dict "name" "app-proxy" "version" (index (get .Values "app-proxy") "image" "tag") }} - {{- $comptList := list $argoEvents $appProxy $sealedSecrets $internalRouter}} + {{- $sourcesServer := dict "name" "sources-server" "version" (get .Subcharts "cf-argocd-extras").Chart.AppVersion }} + {{- $comptList := list $argoEvents $appProxy $sealedSecrets $internalRouter $sourcesServer }} {{- if and (index .Values "argo-cd" "enabled") }} {{- $argoCD := dict "name" "argocd" "version" (get .Subcharts "argo-cd").Chart.AppVersion }} {{- $comptList = append $comptList $argoCD }} @@ -455,6 +456,10 @@ Output comma separated list of installed runtime components {{- $gitopsOperator := dict "name" "gitops-operator" "version" (get .Subcharts "gitops-operator").Chart.AppVersion }} {{- $comptList = append $comptList $gitopsOperator }} {{- end }} + {{- if not (index .Values "argo-cd" "enabled") }} + {{- $eventReporter := dict "name" "event-reporter" "version" (get .Subcharts "cf-argocd-extras").Chart.AppVersion }} + {{- $comptList = append $comptList $eventReporter }} + {{- end }} {{- $comptList | toYaml }} {{- end }} diff --git a/charts/gitops-runtime/tests/cf-argocd-extras_test.yaml b/charts/gitops-runtime/tests/cf-argocd-extras_test.yaml index 6c1ead49..80979628 100644 --- a/charts/gitops-runtime/tests/cf-argocd-extras_test.yaml +++ b/charts/gitops-runtime/tests/cf-argocd-extras_test.yaml @@ -109,3 +109,19 @@ tests: kind: Deployment apiVersion: apps/v1 name: sources-server + + - it: Sources-Server ConfigMap should have valid redis-ha url + template: sources-server.yaml + documentSelector: + path: kind + value: ConfigMap + values: + - ./values/mandatory-values-ingress.yaml + set: + argo-cd: + redis-ha: + enabled: true + asserts: + - equal: + path: data["redis.server"] + value: RELEASE-NAME-redis-ha-haproxy:6379 diff --git a/charts/gitops-runtime/tests/external_argocd_test.yaml b/charts/gitops-runtime/tests/external_argocd_test.yaml index 088bfc27..1ad172dc 100644 --- a/charts/gitops-runtime/tests/external_argocd_test.yaml +++ b/charts/gitops-runtime/tests/external_argocd_test.yaml @@ -8,6 +8,7 @@ templates: - charts/gitops-operator/* - charts/cf-argocd-extras/* - app-proxy/external-argocd-token.yaml + - codefresh-cm.yaml tests: - it: app-proxy ConfigMap should have valid ArgoCd URL values: @@ -727,6 +728,19 @@ tests: - isNotNullOrEmpty: path: stringData.token + - it: codefresh-cm ConfigMap should have event-reporter and sources-server + template: codefresh-cm.yaml + values: + - ./values/mandatory-values-ingress.yaml + - ./values/external-argocd-values.yaml + asserts: + - matchRegex: + path: data.components + pattern: "name: event-reporter" + - matchRegex: + path: data.components + pattern: "name: sources-server" + # TO-DO: fix these tests! # - it: should require ArgoCd token if auth.type=token is set and no token is provided