Skip to content

Commit 0991145

Browse files
committed
move global.external-argo-cd.auth into global.integrations.argo-cd.server.auth
1 parent 080eba2 commit 0991145

File tree

7 files changed

+224
-170
lines changed

7 files changed

+224
-170
lines changed

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

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

18-
{{- $argoCdAuth := (index .Values "global" "external-argo-cd" "auth") }}
18+
{{- $argoCdAuth := (index .Values "global" "integrations" "argo-cd" "server" "auth") }}
1919
{{- if (eq $argoCdAuth.type "token") }}
2020
{{- if $argoCdAuth.token }}
2121
{{- $_ := set $context.Values.container.env "ARGO_CD_TOKEN_SECRET_NAME" "gitops-runtime-argo-cd-token" }}
2222
{{- $_ := set $context.Values.container.env "ARGO_CD_TOKEN_SECRET_KEY" "token" }}
2323
{{- 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) }}
24+
{{- $_ := set $context.Values.container.env "ARGO_CD_TOKEN_SECRET_NAME" (required ".Values.global.integrations.argo-cd.auth.type is set to 'token' therefore .Values.global.integrations.argo-cd.auth.tokenSecretKeyRef.name is required" $argoCdAuth.tokenSecretKeyRef.name) }}
25+
{{- $_ := set $context.Values.container.env "ARGO_CD_TOKEN_SECRET_KEY" (required ".Values.global.integrations.argo-cd.auth.type is set to 'token' therefore .Values.global.integrations.argo-cd.auth.tokenSecretKeyRef.key is required" $argoCdAuth.tokenSecretKeyRef.key) }}
2626
{{- else }}
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" }}
27+
{{ fail ".Values.global.integrations.argo-cd.auth.type is 'token' and .Values.global.integrations.argo-cd.auth.token or .Values.global.integrations.argo-cd.auth.tokenSecretKeyRef are not set" }}
2828
{{- end }}
2929
{{- end }}
3030

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

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

18-
{{- $argoCdAuth := (index .Values "global" "external-argo-cd" "auth") }}
18+
{{- $argoCdAuth := (index .Values "global" "integrations" "argo-cd" "server" "auth") }}
1919
{{- if (eq $argoCdAuth.type "token") }}
2020
{{- if $argoCdAuth.token }}
2121
{{- $_ := set $context.Values.container.env "ARGO_CD_TOKEN_SECRET_NAME" "gitops-runtime-argo-cd-token" }}
2222
{{- $_ := set $context.Values.container.env "ARGO_CD_TOKEN_SECRET_KEY" "token" }}
2323
{{- 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) }}
24+
{{- $_ := set $context.Values.container.env "ARGO_CD_TOKEN_SECRET_NAME" (required ".Values.global.integrations.argo-cd.auth.type is set to 'token' therefore .Values.global.integrations.argo-cd.auth.tokenSecretKeyRef.name is required" $argoCdAuth.tokenSecretKeyRef.name) }}
25+
{{- $_ := set $context.Values.container.env "ARGO_CD_TOKEN_SECRET_KEY" (required ".Values.global.integrations.argo-cd.auth.type is set to 'token' therefore .Values.global.integrations.argo-cd.auth.tokenSecretKeyRef.key is required" $argoCdAuth.tokenSecretKeyRef.key) }}
2626
{{- else }}
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" }}
27+
{{ fail ".Values.global.integrations.argo-cd.auth.type is 'token' and .Values.global.integrations.argo-cd.auth.token or .Values.global.integrations.argo-cd.auth.tokenSecretKeyRef are not set" }}
2828
{{- end }}
2929
{{- end }}
3030

charts/gitops-runtime/templates/_helpers.tpl

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -236,8 +236,8 @@ Determine argocd server url witout the protocol. Must be called with chart root
236236
{{- end}}
237237

238238
{{- define "codefresh-gitops-runtime.argocd-auth" -}}
239-
{{- $authValues := (index .Values "global" "external-argo-cd" "auth") }}
240-
{{- if (eq $authValues.type "password") }}
239+
{{- $argoCdAuth := (index .Values "global" "integrations" "argo-cd" "server" "auth") }}
240+
{{- if (eq $argoCdAuth.type "password") }}
241241
ARGO_CD_USERNAME:
242242
valueFrom:
243243
configMapKeyRef:
@@ -246,38 +246,38 @@ ARGO_CD_USERNAME:
246246
ARGO_CD_PASSWORD:
247247
valueFrom:
248248
secretKeyRef:
249-
{{- if $authValues.password }}
249+
{{- if $argoCdAuth.password }}
250250
name: gitops-runtime-argo-cd-password
251251
key: token
252-
{{- else if $authValues.passwordSecretKeyRef }}
253-
{{- $authValues.passwordSecretKeyRef | toYaml | nindent 6 }}
252+
{{- else if $argoCdAuth.passwordSecretKeyRef }}
253+
{{- $argoCdAuth.passwordSecretKeyRef | toYaml | nindent 6 }}
254254
{{- end }}
255-
{{- else if (eq $authValues.type "token") }}
255+
{{- else if (eq $argoCdAuth.type "token") }}
256256
ARGO_CD_TOKEN:
257257
valueFrom:
258258
secretKeyRef:
259-
{{- if $authValues.token }}
259+
{{- if $argoCdAuth.token }}
260260
name: gitops-runtime-argo-cd-token
261261
key: token
262-
{{- else if $authValues.tokenSecretKeyRef }}
263-
{{- if and (hasKey $authValues.tokenSecretKeyRef "name") (hasKey $authValues.tokenSecretKeyRef "key") }}
264-
{{- $authValues.tokenSecretKeyRef | toYaml | nindent 6 }}
262+
{{- else if $argoCdAuth.tokenSecretKeyRef }}
263+
{{- if and (hasKey $argoCdAuth.tokenSecretKeyRef "name") (hasKey $argoCdAuth.tokenSecretKeyRef "key") }}
264+
{{- $argoCdAuth.tokenSecretKeyRef | toYaml | nindent 6 }}
265265
{{- else }}
266-
{{- fail "Both 'name' and 'key' must be set in .Values.global.external-argo-cd.auth.tokenSecretKeyRef" }}
266+
{{- fail "Both 'name' and 'key' must be set in .Values.global.integrations.argo-cd.auth.tokenSecretKeyRef" }}
267267
{{- end }}
268268
{{- end }}
269269
{{- else }}
270-
{{ fail (printf "Invalid value for .Values.global.external-argo-cd.auth.type: %s. Allowed values are: [password token]" $authValues.type) }}
270+
{{ fail (printf "Invalid value for .Values.global.integrations.argo-cd.auth.type: %s. Allowed values are: [password token]" $argoCdAuth.type) }}
271271
{{- end }}
272272
{{- end }}
273273

274274
{{/*
275275
Determine argocd server username ConfigMap.
276276
*/}}
277277
{{- define "codefresh-gitops-runtime.argocd.server.username-cm" }}
278-
{{- $externalArgoCDValues := (index .Values "global" "external-argo-cd" "auth") }}
278+
{{- $externalArgoCDValues := (index .Values "global" "integrations" "argo-cd" "server" "auth") }}
279279
{{- if (eq $externalArgoCDValues.type "password") }}
280-
{{- coalesce (index .Values "app-proxy" "config" "argoCdUsername") (index .Values "global" "external-argo-cd" "auth" "username") "" }}
280+
{{- coalesce (index .Values "app-proxy" "config" "argoCdUsername") (index .Values "global" "integrations" "argo-cd" "server" "auth" "username") "" }}
281281
{{- end }}
282282
{{- end }}
283283

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
{{- $externalArgoCDValues := (index .Values "global" "external-argo-cd" "auth") }}
2-
{{- if $externalArgoCDValues.password }}
1+
{{- $argoCdAuth := (index .Values "global" "integrations" "argo-cd" "server" "auth") }}
2+
{{- if $argoCdAuth.password }}
33
---
44
apiVersion: v1
55
kind: Secret
@@ -9,10 +9,10 @@ metadata:
99
{{- include "codefresh-gitops-runtime.labels" . | nindent 4 }}
1010
type: Opaque
1111
stringData:
12-
token: {{ $externalArgoCDValues.password }}
12+
token: {{ $argoCdAuth.password }}
1313
{{- end }}
1414

15-
{{- if $externalArgoCDValues.token }}
15+
{{- if $argoCdAuth.token }}
1616
---
1717
apiVersion: v1
1818
kind: Secret
@@ -22,5 +22,5 @@ metadata:
2222
{{- include "codefresh-gitops-runtime.labels" . | nindent 4 }}
2323
type: Opaque
2424
stringData:
25-
token: {{ $externalArgoCDValues.token }}
25+
token: {{ $argoCdAuth.token }}
2626
{{- end }}

charts/gitops-runtime/templates/gitops-operator/deployment.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,16 @@
66
{{- $_ := set $context "Values" $vals }}
77
{{- $_ := set $context.Values "global" (deepCopy (get .Values "global")) }}
88

9-
{{- $argoCdAuth := (index .Values "global" "external-argo-cd" "auth") }}
9+
{{- $argoCdAuth := (index .Values "global" "integrations" "argo-cd" "server" "auth") }}
1010
{{- if (eq $argoCdAuth.type "token") }}
1111
{{- if $argoCdAuth.token }}
1212
{{- $_ := set $context.Values.env "ARGO_CD_TOKEN_SECRET_NAME" "gitops-runtime-argo-cd-token" }}
1313
{{- $_ := set $context.Values.env "ARGO_CD_TOKEN_SECRET_KEY" "token" }}
1414
{{- else if $argoCdAuth.tokenSecretKeyRef }}
15-
{{- $_ := set $context.Values.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) }}
16-
{{- $_ := set $context.Values.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) }}
15+
{{- $_ := set $context.Values.env "ARGO_CD_TOKEN_SECRET_NAME" (required ".Values.global.integrations.argo-cd.auth.type is set to 'token' therefore .Values.global.integrations.argo-cd.auth.tokenSecretKeyRef.name is required" $argoCdAuth.tokenSecretKeyRef.name) }}
16+
{{- $_ := set $context.Values.env "ARGO_CD_TOKEN_SECRET_KEY" (required ".Values.global.integrations.argo-cd.auth.type is set to 'token' therefore .Values.global.integrations.argo-cd.auth.tokenSecretKeyRef.key is required" $argoCdAuth.tokenSecretKeyRef.key) }}
1717
{{- else }}
18-
{{ 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" }}
18+
{{ fail ".Values.global.integrations.argo-cd.auth.type is 'token' and .Values.global.integrations.argo-cd.auth.token or .Values.global.integrations.argo-cd.auth.tokenSecretKeyRef are not set" }}
1919
{{- end }}
2020
{{- end }}
2121

0 commit comments

Comments
 (0)