Skip to content

Commit e4298f5

Browse files
committed
inject username/password OR token into app-proxy env
1 parent eb87429 commit e4298f5

File tree

12 files changed

+204
-191
lines changed

12 files changed

+204
-191
lines changed

charts/gitops-runtime/templates/_components/cap-app-proxy/_config.yaml

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,7 @@
1-
{{- define "cap-app-proxy.resources.configmap-documented-configs"}}
2-
argoCdUrl: {{ .Values.config.argoCdUrl }}
3-
argoCdUsername: {{ .Values.config.argoCdUsername }}
1+
{{- define "cap-app-proxy.resources.configmap-documented-configs" }}
42
argoWorkflowsInsecure: {{ .Values.config.argoWorkflowsInsecure | quote }}
5-
argoWorkflowsUrl: {{ default "" .Values.config.argoWorkflowsUrl }}
3+
clusterChunkSize: {{ .Values.config.clusterChunkSize | quote }}
64
cors: {{ .Values.global.codefresh.url }}
7-
{{- with .Values.config.clusterChunkSize }}
8-
clusterChunkSize: {{ . | quote }}
9-
{{- end }}
10-
env: {{ .Values.config.env | quote}}
115
isConfigurationRuntime: {{ .Values.global.runtime.isConfigurationRuntime | quote }}
126
isExternalArgoCD: {{ .Values.global.runtime.isExternalArgoCD | quote }}
137
runtimeName: {{ required "global.runtime.name is required" .Values.global.runtime.name | quote}}
@@ -31,7 +25,7 @@ enrichmentJiraEnrichmentImage: {{ printf "%s/%s:%s" $enrichmentValues.config.ima
3125

3226
{{- define "cap-app-proxy.resources.configmap" }}
3327
{{- $documentedConfigs := (include "cap-app-proxy.resources.configmap-documented-configs" . | fromYaml ) }}
34-
{{- $overrides := omit .Values.config "clusterChunkSize" }}
28+
{{- $overrides := omit .Values.config "argoWorkflowsInsecure" "clusterChunkSize" "cors" "singleNamespace" "skipGitPermissionValidation" }}
3529
{{- $mergedConfig := mergeOverwrite $documentedConfigs $overrides }}
3630
apiVersion: v1
3731
kind: ConfigMap

charts/gitops-runtime/templates/_components/cap-app-proxy/environment-variables/_main-container.yaml

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,6 @@ ARGO_CD_URL:
55
name: cap-app-proxy-cm
66
key: argoCdUrl
77
optional: true
8-
ARGO_CD_TOKEN: {{ include "codefresh-gitops-runtime.argocd.server.token" . | nindent 2 }}
9-
ARGO_CD_USERNAME: {{ include "codefresh-gitops-runtime.argocd.server.username-env-var" . | nindent 2 }}
10-
ARGO_CD_PASSWORD: {{ include "codefresh-gitops-runtime.argocd.server.password" . | nindent 2 }}
118
ARGO_WORKFLOWS_INSECURE:
129
valueFrom:
1310
configMapKeyRef:
@@ -231,8 +228,9 @@ LEADER_ID:
231228
Read defaults from the template above and merge with the values provided in values file
232229
*/}}
233230
{{- define "cap-app-proxy.environment-variables" -}}
234-
{{- $defaults := (include "cap-app-proxy.environment-variables.defaults" . | fromYaml) }}
235-
{{- $overrides := .Values.env }}
236-
{{- $mergedValues := mergeOverwrite $defaults $overrides }}
237-
{{- include "codefresh-gitops-runtime.components.common_helpers.container-templates.env-vars" $mergedValues }}
231+
{{- $defaults := (include "cap-app-proxy.environment-variables.defaults" . | fromYaml) }}
232+
{{- $argoCdAuth := (include "codefresh-gitops-runtime.argocd-auth" . | fromYaml) }}
233+
{{- $overrides := .Values.env }}
234+
{{- $mergedValues := mergeOverwrite $defaults $argoCdAuth $overrides }}
235+
{{- include "codefresh-gitops-runtime.components.common_helpers.container-templates.env-vars" $mergedValues }}
238236
{{- end -}}

charts/gitops-runtime/templates/_components/cf-argocd-extras/event-reporter/_statefulset.yaml

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,16 @@
1515
{{- $_ := set $context.Values.container.env.REDIS_PASSWORD.valueFrom.secretKeyRef "key" (default "redis-password" $vals.externalRedis.existingSecretKeyRef.key) }}
1616
{{- end }}
1717

18-
{{- if and (eq (index $context.Values "global" "external-argo-cd" "auth" "type") "token") }}
19-
{{- if not (index $context.Values "global" "external-argo-cd" "auth" "token") }}
20-
{{- $_ := set $context.Values.container.env "ARGO_CD_TOKEN_SECRET_NAME" (required ".Values.global.external-argo-cd.auth.type is set to 'token' therefore .Values.global.external-argo-cd.auth.tokenSecretKeyRef.name is required" (index $context.Values "global" "external-argo-cd" "auth" "tokenSecretKeyRef" "name")) }}
21-
{{- $_ := set $context.Values.container.env "ARGO_CD_TOKEN_SECRET_KEY" (required ".Values.global.external-argo-cd.auth.type is set to 'token' therefore .Values.global.external-argo-cd.auth.tokenSecretKeyRef.key is required" (index $context.Values "global" "external-argo-cd" "auth" "tokenSecretKeyRef" "key" )) }}
18+
{{- $argoCdAuth := (index .Values "global" "external-argo-cd" "auth") }}
19+
{{- if (eq $argoCdAuth.type "token") }}
20+
{{- if $argoCdAuth.token }}
21+
{{- $_ := set $context.Values.container.env "ARGO_CD_TOKEN_SECRET_NAME" "gitops-runtime-argo-cd-token" }}
22+
{{- $_ := set $context.Values.container.env "ARGO_CD_TOKEN_SECRET_KEY" "token" }}
23+
{{- else if $argoCdAuth.tokenSecretKeyRef }}
24+
{{- $_ := set $context.Values.container.env "ARGO_CD_TOKEN_SECRET_NAME" (required ".Values.global.external-argo-cd.auth.type is set to 'token' therefore .Values.global.external-argo-cd.auth.tokenSecretKeyRef.name is required" $argoCdAuth.tokenSecretKeyRef.name) }}
25+
{{- $_ := set $context.Values.container.env "ARGO_CD_TOKEN_SECRET_KEY" (required ".Values.global.external-argo-cd.auth.type is set to 'token' therefore .Values.global.external-argo-cd.auth.tokenSecretKeyRef.key is required" $argoCdAuth.tokenSecretKeyRef.key) }}
2226
{{- else }}
23-
{{- $_ := set $context.Values.container.env "ARGO_CD_TOKEN_SECRET_NAME" "gitops-runtime-argo-cd-token" }}
24-
{{- $_ := set $context.Values.container.env "ARGO_CD_TOKEN_SECRET_KEY" "token" }}
27+
{{ fail ".Values.global.external-argo-cd.auth.type is 'token' and .Values.global.external-argo-cd.auth.token or .Values.global.external-argo-cd.auth.tokenSecretKeyRef are not set" }}
2528
{{- end }}
2629
{{- end }}
2730

charts/gitops-runtime/templates/_components/cf-argocd-extras/sources-server/_deployment.yaml

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,16 @@
1515
{{- $_ := set $context.Values.container.env.REDIS_PASSWORD.valueFrom.secretKeyRef "key" (default "redis-password" $vals.externalRedis.existingSecretKeyRef.key) }}
1616
{{- end }}
1717

18-
{{- if and (eq (index $context.Values "global" "external-argo-cd" "auth" "type") "token") }}
19-
{{- if not (index $context.Values "global" "external-argo-cd" "auth" "token") }}
20-
{{- $_ := set $context.Values.container.env "ARGO_CD_TOKEN_SECRET_NAME" (required ".Values.global.external-argo-cd.auth.type is set to 'token' therefore .Values.global.external-argo-cd.auth.tokenSecretKeyRef.name is required" (index $context.Values "global" "external-argo-cd" "auth" "tokenSecretKeyRef" "name")) }}
21-
{{- $_ := set $context.Values.container.env "ARGO_CD_TOKEN_SECRET_KEY" (required ".Values.global.external-argo-cd.auth.type is set to 'token' therefore .Values.global.external-argo-cd.auth.tokenSecretKeyRef.key is required" (index $context.Values "global" "external-argo-cd" "auth" "tokenSecretKeyRef" "key" )) }}
18+
{{- $argoCdAuth := (index .Values "global" "external-argo-cd" "auth") }}
19+
{{- if (eq $argoCdAuth.type "token") }}
20+
{{- if $argoCdAuth.token }}
21+
{{- $_ := set $context.Values.container.env "ARGO_CD_TOKEN_SECRET_NAME" "gitops-runtime-argo-cd-token" }}
22+
{{- $_ := set $context.Values.container.env "ARGO_CD_TOKEN_SECRET_KEY" "token" }}
23+
{{- else if $argoCdAuth.tokenSecretKeyRef }}
24+
{{- $_ := set $context.Values.container.env "ARGO_CD_TOKEN_SECRET_NAME" (required ".Values.global.external-argo-cd.auth.type is set to 'token' therefore .Values.global.external-argo-cd.auth.tokenSecretKeyRef.name is required" $argoCdAuth.tokenSecretKeyRef.name) }}
25+
{{- $_ := set $context.Values.container.env "ARGO_CD_TOKEN_SECRET_KEY" (required ".Values.global.external-argo-cd.auth.type is set to 'token' therefore .Values.global.external-argo-cd.auth.tokenSecretKeyRef.key is required" $argoCdAuth.tokenSecretKeyRef.key) }}
2226
{{- else }}
23-
{{- $_ := set $context.Values.container.env "ARGO_CD_TOKEN_SECRET_NAME" "gitops-runtime-argo-cd-token" }}
24-
{{- $_ := set $context.Values.container.env "ARGO_CD_TOKEN_SECRET_KEY" "token" }}
27+
{{ fail ".Values.global.external-argo-cd.auth.type is 'token' and .Values.global.external-argo-cd.auth.token or .Values.global.external-argo-cd.auth.tokenSecretKeyRef are not set" }}
2528
{{- end }}
2629
{{- end }}
2730

charts/gitops-runtime/templates/_helpers.tpl

Lines changed: 48 additions & 94 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ Determine argocd repo server service name. Must be called with chart root contex
9494
*/}}
9595
{{- define "codefresh-gitops-runtime.argocd.reposerver.servicename" -}}
9696
{{/* For now use template from ArgoCD chart until better approach */}}
97-
{{- if and (index .Subcharts "argo-cd") }}
97+
{{- if (index .Subcharts "argo-cd") }}
9898
{{- template "argo-cd.repoServer.fullname" (dict "Values" (get .Values "argo-cd") "Release" .Release ) }}
9999
{{- else }}
100100
{{- $repoServer := index .Values "global" "external-argo-cd" "repoServer" }}
@@ -108,7 +108,7 @@ Determine argocd argocd repo server port
108108
*/}}
109109
{{- define "codefresh-gitops-runtime.argocd.reposerver.serviceport" -}}
110110
{{/* For now use template from ArgoCD chart until better approach */}}
111-
{{- if and (index .Subcharts "argo-cd") }}
111+
{{- if (index .Subcharts "argo-cd") }}
112112
{{- index .Values "argo-cd" "repoServer" "service" "port" }}
113113
{{- else }}
114114
{{- $repoServer := index .Values "global" "external-argo-cd" "repoServer" }}
@@ -123,11 +123,11 @@ Determine argocd repoServer url
123123
*/}}
124124
{{- define "codefresh-gitops-runtime.argocd.reposerver.url" -}}
125125
{{- $argoCDValues := (get .Values "argo-cd") }}
126-
{{- if and (index .Values "argo-cd" "enabled") }}
126+
{{- if (index .Values "argo-cd" "enabled") }}
127127
{{- $serviceName := include "codefresh-gitops-runtime.argocd.reposerver.servicename" . }}
128128
{{- $port := include "codefresh-gitops-runtime.argocd.reposerver.serviceport" . }}
129129
{{- printf "%s:%s" $serviceName $port }}
130-
{{- else if and (index .Values "global" "external-argo-cd" "repoServer") }}
130+
{{- else if (index .Values "global" "external-argo-cd" "repoServer") }}
131131
{{- $repoServer := (index .Values "global" "external-argo-cd" "repoServer") }}
132132
{{- $svc := required "ArgoCD is not enabled and .Values.global.external-argo-cd.repoServer.svc is not set" $repoServer.svc }}
133133
{{- $port := required "ArgoCD is not enabled and .Values.global.external-argo-cd.repoServer.port is not set" $repoServer.port }}
@@ -150,7 +150,7 @@ Determine argocd servicename. Must be called with chart root context
150150
Determine rollouts name
151151
*/}}
152152
{{- define "codefresh-gitops-runtime.argo-rollouts.name" -}}
153-
{{- if and (index .Values "argo-rollouts" "enabled") }}
153+
{{- if (index .Values "argo-rollouts" "enabled") }}
154154
{{/* For now use template from rollouts chart until better approach */}}
155155
{{- template "argo-rollouts.fullname" (dict "Values" (get .Values "argo-rollouts")) }}
156156
{{- else }}
@@ -190,21 +190,21 @@ Determine argocd redis service port. Must be called with chart root context
190190
Determine argocd server url. Must be called with chart root context
191191
*/}}
192192
{{- define "codefresh-gitops-runtime.argocd.server.url" -}}
193-
{{- if and (index .Values "argo-cd" "enabled") }}
193+
{{- if (index .Values "argo-cd" "enabled") }}
194194
{{- $protocol := "https" }}
195195
{{- $port := include "codefresh-gitops-runtime.argocd.server.serviceport" . }}
196196
{{- if (eq $port "80") }}
197197
{{- $protocol = "http" }}
198198
{{- end }}
199199
{{- $url := include "codefresh-gitops-runtime.argocd.server.no-protocol-url" . }}
200200
{{- printf "%s://%s" $protocol $url }}
201-
{{- else if and (index .Values "global" "external-argo-cd" "server") }}
201+
{{- else if (index .Values "global" "external-argo-cd" "server") }}
202202
{{- $argoCDSrv := (index .Values "global" "external-argo-cd" "server") }}
203203
{{- $protocol := "http" }}
204204
{{- $svc := required "ArgoCD is not enabled and .Values.global.external-argo-cd.server.svc is not set" $argoCDSrv.svc }}
205205
{{- $port := (required "ArgoCD is not enabled and .Values.global.external-argo-cd.server.port is not port" $argoCDSrv.port) | toString }}
206206
{{- $rootpath := (index .Values "global" "external-argo-cd" "server" "rootpath") }}
207-
{{- if and (eq $port "80") }}
207+
{{- if (eq $port "80") }}
208208
{{- printf "%s://%s%s" $protocol $svc $rootpath }}
209209
{{- else }}
210210
{{- printf "%s://%s:%s%s" $protocol $svc $port $rootpath }}
@@ -219,12 +219,12 @@ Determine argocd server url witout the protocol. Must be called with chart root
219219
*/}}
220220
{{- define "codefresh-gitops-runtime.argocd.server.no-protocol-url" -}}
221221
{{- $argoCDValues := (get .Values "argo-cd") }}
222-
{{- if and (index .Values "argo-cd" "enabled") }}
222+
{{- if (index .Values "argo-cd" "enabled") }}
223223
{{- $serverName := include "codefresh-gitops-runtime.argocd.server.servicename" . }}
224224
{{- $port := include "codefresh-gitops-runtime.argocd.server.serviceport" . }}
225225
{{- $path := (get $argoCDValues.configs.params "server.rootpath") }}
226226
{{- printf "%s:%s%s" $serverName $port $path }}
227-
{{- else if and (index .Values "global" "external-argo-cd" "server") }}
227+
{{- else if (index .Values "global" "external-argo-cd" "server") }}
228228
{{- $argoCDSrv := (index .Values "global" "external-argo-cd" "server") }}
229229
{{- $svc := required "ArgoCD is not enabled and .Values.global.external-argo-cd.server.svc is not set" $argoCDSrv.svc }}
230230
{{- $port := required "ArgoCD is not enabled and .Values.global.external-argo-cd.server.port is not set" $argoCDSrv.port }}
@@ -235,95 +235,49 @@ Determine argocd server url witout the protocol. Must be called with chart root
235235
{{- end }}
236236
{{- end}}
237237

238-
{{/*
239-
Determine argocd server password.
240-
*/}}
241-
{{- define "codefresh-gitops-runtime.argocd.server.password" }}
242-
{{- if and (index .Values "argo-cd" "enabled") }}
243-
valueFrom:
244-
secretKeyRef:
245-
name: argocd-initial-admin-secret
246-
key: password
247-
{{- else if and (eq (index .Values "global" "external-argo-cd" "auth" "type") "password") (index .Values "global" "external-argo-cd" "auth" "passwordSecretKeyRef") }}
248-
valueFrom:
249-
secretKeyRef:
250-
{{- index .Values "global" "external-argo-cd" "auth" "passwordSecretKeyRef" | toYaml | nindent 4 }}
251-
{{- else if and (eq (index .Values "global" "external-argo-cd" "auth" "type") "password") (index .Values "global" "external-argo-cd" "auth" "password") }}
252-
valueFrom:
253-
secretKeyRef:
254-
name: gitops-runtime-argo-cd-password
255-
key: token
256-
{{- else if and (eq (index .Values "global" "external-argo-cd" "auth" "type") "token") (index .Values "global" "external-argo-cd" "auth" "token") }}
257-
valueFrom:
258-
secretKeyRef:
259-
name: gitops-runtime-argo-cd-token
260-
key: token
261-
{{- else if and (eq (index .Values "global" "external-argo-cd" "auth" "type") "token") (index .Values "global" "external-argo-cd" "auth" "tokenSecretKeyRef") }}
262-
valueFrom:
263-
secretKeyRef:
264-
{{- index .Values "global" "external-argo-cd" "auth" "tokenSecretKeyRef" | toYaml | nindent 4 }}
265-
optional: true
266-
{{- else }}
267-
{{ fail "ArgoCD is not enabled and .Values.global.external-argo-cd.auth.password or .Values.global.external-argo-cd.auth.passwordSecretKeyRef is not set" }}
268-
{{- end }}
269-
{{- end }}
270-
271-
272-
{{/*
273-
Determine argocd token password.
274-
*/}}
275-
{{- define "codefresh-gitops-runtime.argocd.server.token" }}
276-
{{- if and (eq (index .Values "global" "external-argo-cd" "auth" "type") "token") (index .Values "global" "external-argo-cd" "auth" "tokenSecretKeyRef" "name") (index .Values "global" "external-argo-cd" "auth" "tokenSecretKeyRef" "key")}}
277-
valueFrom:
278-
secretKeyRef:
279-
{{- index .Values "global" "external-argo-cd" "auth" "tokenSecretKeyRef" | toYaml | nindent 4 }}
280-
{{- else if and (eq (index .Values "global" "external-argo-cd" "auth" "type") "token") (index .Values "global" "external-argo-cd" "auth" "token") }}
281-
valueFrom:
282-
secretKeyRef:
283-
name: gitops-runtime-argo-cd-token
284-
key: token
285-
{{- else if or (eq (index .Values "global" "external-argo-cd" "auth" "type") "password") }}
286-
valueFrom:
287-
secretKeyRef:
288-
name: argocd-token
289-
key: token
290-
optional: true
291-
{{- else }}
292-
{{ fail (printf "Invalid value for .Values.global.external-argo-cd.auth.type: %s. Allowed values are: [password token]" (index .Values "global" "external-argo-cd" "auth" "type")) }}
293-
{{- end }}
294-
{{- end }}
295-
296-
{{/*
297-
Determine argocd server password.
298-
*/}}
299-
{{- define "codefresh-gitops-runtime.argocd.server.username-env-var" }}
300-
{{- if and (index .Values "argo-cd" "enabled") }}
301-
valueFrom:
302-
configMapKeyRef:
303-
name: cap-app-proxy-cm
304-
key: argoCdUsername
305-
optional: true
306-
{{- else if and (index .Values "global" "external-argo-cd" "auth" "usernameSecretKeyRef") }}
307-
valueFrom:
308-
secretKeyRef:
309-
{{- index .Values "global" "external-argo-cd" "auth" "usernameSecretKeyRef" | toYaml | nindent 4 }}
310-
{{- else if and (index .Values "global" "external-argo-cd" "auth" "username") }}
311-
{{- printf "%s" (index .Values "global" "external-argo-cd" "auth" "username") }}
238+
{{- define "codefresh-gitops-runtime.argocd-auth" -}}
239+
{{- $authValues := (index .Values "global" "external-argo-cd" "auth") }}
240+
{{- if (eq $authValues.type "password") }}
241+
ARGO_CD_USERNAME:
242+
valueFrom:
243+
configMapKeyRef:
244+
name: cap-app-proxy-cm
245+
key: argoCdUsername
246+
ARGO_CD_PASSWORD:
247+
valueFrom:
248+
secretKeyRef:
249+
{{- if $authValues.password }}
250+
name: gitops-runtime-argo-cd-password
251+
key: token
252+
{{- else if $authValues.passwordSecretKeyRef }}
253+
{{- $authValues.passwordSecretKeyRef | toYaml | nindent 6 }}
254+
{{- end }}
255+
{{- else if (eq $authValues.type "token") }}
256+
ARGO_CD_TOKEN:
257+
valueFrom:
258+
secretKeyRef:
259+
{{- if $authValues.token }}
260+
name: gitops-runtime-argo-cd-token
261+
key: token
262+
{{- else if $authValues.tokenSecretKeyRef }}
263+
{{- if and (hasKey $authValues.tokenSecretKeyRef "name") (hasKey $authValues.tokenSecretKeyRef "key") }}
264+
{{- $authValues.tokenSecretKeyRef | toYaml | nindent 6 }}
265+
{{- else }}
266+
{{- fail "Both 'name' and 'key' must be set in .Values.global.external-argo-cd.auth.tokenSecretKeyRef" }}
267+
{{- end }}
268+
{{- end }}
312269
{{- else }}
313-
{{ fail "ArgoCD is not enabled and .Values.global.external-argo-cd.auth.username or .Values.global.external-argo-cd.auth.usernameSecretKeyRef is not set" }}
270+
{{ fail (printf "Invalid value for .Values.global.external-argo-cd.auth.type: %s. Allowed values are: [password token]" $authValues.type) }}
314271
{{- end }}
315272
{{- end }}
316273

317274
{{/*
318-
Determine argocd server password.
275+
Determine argocd server username ConfigMap.
319276
*/}}
320277
{{- define "codefresh-gitops-runtime.argocd.server.username-cm" }}
321-
{{- if and (index .Values "argo-cd" "enabled") }}
322-
{{- printf "%s" (index .Values "app-proxy" "config" "argoCdUsername") }}
323-
{{- else if and (index .Values "global" "external-argo-cd" "auth" "username") }}
324-
{{- printf "%s" (index .Values "global" "external-argo-cd" "auth" "username") }}
325-
{{- else }}
326-
{{- fail "ArgoCD is not enabled and .Values.global.external-argo-cd.auth.username is not set" }}
278+
{{- $externalArgoCDValues := (index .Values "global" "external-argo-cd" "auth") }}
279+
{{- if (eq $externalArgoCDValues.type "password") }}
280+
{{- coalesce (index .Values "app-proxy" "config" "argoCdUsername") (index .Values "global" "external-argo-cd" "auth" "username") "" }}
327281
{{- end }}
328282
{{- end }}
329283

@@ -332,11 +286,11 @@ Determine argocd redis url
332286
*/}}
333287
{{- define "codefresh-gitops-runtime.argocd.redis.url" -}}
334288
{{- $argoCDValues := (get .Values "argo-cd") }}
335-
{{- if and (index .Values "argo-cd" "enabled") }}
289+
{{- if (index .Values "argo-cd" "enabled") }}
336290
{{- $serviceName := include "codefresh-gitops-runtime.argocd.redis.servicename" . }}
337291
{{- $port := include "codefresh-gitops-runtime.argocd.redis.serviceport" . }}
338292
{{- printf "%s:%s" $serviceName $port }}
339-
{{- else if and (index .Values "global" "external-argo-cd" "redis") }}
293+
{{- else if (index .Values "global" "external-argo-cd" "redis") }}
340294
{{- $redis := (index .Values "global" "external-argo-cd" "redis") }}
341295
{{- $svc := required "ArgoCD is not enabled and .Values.global.external-argo-cd.redis.svc is not set" $redis.svc }}
342296
{{- $port := required "ArgoCD is not enabled and .Values.global.external-argo-cd.redis.port is not set" $redis.port }}

charts/gitops-runtime/templates/app-proxy/config.yaml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,11 @@
77
{{- if not $appProxyContext.Values.config.argoCdUrl }}
88
{{ $_ := set $appProxyContext.Values.config "argoCdUrl" $argoCdUrl }}
99
{{- end }}
10-
{{- $_ := set $appProxyContext.Values.config "argoCdUsername" $argoCdUsername }}
10+
{{- if $argoCdUsername }}
11+
{{- $_ := set $appProxyContext.Values.config "argoCdUsername" $argoCdUsername }}
12+
{{- else }}
13+
{{ $_ := unset $appProxyContext.Values.config "argoCdUsername" }}
14+
{{- end }}
1115
{{- if index (get .Values "argo-workflows") "enabled" }}
1216
{{- if not $appProxyContext.Values.config.argoWorkflowsUrl }}
1317
{{- $argoWorkflowsUrl := include "codefresh-gitops-runtime.argo-workflows.server.url" . }}

0 commit comments

Comments
 (0)