Skip to content

Commit 6e27e7a

Browse files
feat: external argocd unders .values.global.integrations
1 parent 1b0a2db commit 6e27e7a

File tree

4 files changed

+18
-49
lines changed

4 files changed

+18
-49
lines changed

charts/gitops-runtime/templates/_helpers.tpl

Lines changed: 4 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -77,24 +77,15 @@ Create the name of the service account to use
7777
Determine argocd server service name. Must be called with chart root context
7878
*/}}
7979
{{- define "codefresh-gitops-runtime.argocd.server.servicename" -}}
80-
{{/* For now use template from ArgoCD chart until better approach */}}
81-
{{- template "argo-cd.server.fullname" (dict "Values" (get .Values "argo-cd") "Release" .Release ) }}
82-
{{- end }}
83-
84-
{{/*
85-
Determine argocd redis service name. Must be called with chart root context
86-
*/}}
87-
{{- define "codefresh-gitops-runtime.argocd.redis.servicename" -}}
88-
{{/* For now use template from ArgoCD chart until better approach */}}
89-
{{- template "argo-cd.redis.fullname" (dict "Values" (get .Values "argo-cd") "Release" .Release ) }}
80+
{{- printf "%s-%s" (index .Values "argo-cd" "fullnameOverride") (index .Values "argo-cd" "server" "name") }}
9081
{{- end }}
9182

9283
{{/*
9384
Determine argocd repo server service name. Must be called with chart root context
9485
*/}}
9586
{{- define "codefresh-gitops-runtime.argocd.reposerver.servicename" -}}
9687
{{- if (index .Subcharts "argo-cd") }}
97-
{{- template "argo-cd.repoServer.fullname" (dict "Values" (get .Values "argo-cd") "Release" .Release ) }}
88+
{{- printf "%s-%s" (index .Values "argo-cd" "fullnameOverride") (index .Values "argo-cd" "repoServer" "name") }}
9889
{{- else }}
9990
{{- $repoServer := index .Values "global" "integrations" "argo-cd" "repoServer" }}
10091
{{- $svc := required ".Values.global.integrations.argo-cd.repoServer.svc is not set" $repoServer.svc }}
@@ -132,15 +123,6 @@ Determine argocd repoServer url
132123
{{- end }}
133124
{{- end}}
134125

135-
136-
{{/*
137-
Determine argocd servicename. Must be called with chart root context
138-
*/}}
139-
{{- define "codefresh-gitops-runtime.argocd.appcontroller.serviceAccountName" -}}
140-
{{/* For now use template from ArgoCD chart until better approach */}}
141-
{{- template "argo-cd.controllerServiceAccountName" (dict "Values" (get .Values "argo-cd") "Release" .Release ) }}
142-
{{- end }}
143-
144126
{{/*
145127
Determine rollouts name
146128
*/}}
@@ -153,7 +135,6 @@ Determine rollouts name
153135
{{- end }}
154136
{{- end }}
155137

156-
157138
{{/*
158139
Determine argocd server service port. Must be called with chart root context
159140
*/}}
@@ -219,8 +200,8 @@ Determine argocd server url witout the protocol. Must be called with chart root
219200
{{- printf "%s:%s%s" $serverName $port $path }}
220201
{{- else }}
221202
{{- $argoCDSrv := (index .Values "global" "integrations" "argo-cd" "server") }}
222-
{{- $svc := required "ArgoCD is not enabled and .Values.global.integrations.argo-cd.server.svc is not set" $argoCDSrv.svc }}
223-
{{- $port := required "ArgoCD is not enabled and .Values.global.integrations.argo-cd.server.port is not set" $argoCDSrv.port }}
203+
{{- $svc := required ".Values.global.integrations.argo-cd.server.svc is not set" $argoCDSrv.svc }}
204+
{{- $port := required ".Values.global.integrations.argo-cd.server.port is not set" $argoCDSrv.port }}
224205
{{- $rootpath := (index .Values "global" "integrations" "argo-cd" "server" "rootpath") }}
225206
{{- printf "%s:%v%s" $svc $port $rootpath }}
226207
{{- end }}

charts/gitops-runtime/tests/argo-api-gateway_test.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,13 @@ tests:
1010
asserts:
1111
- equal:
1212
path: data["argocd.server"]
13-
value: argo-cd-server:80
13+
value: argocd-server:80
1414
- equal:
1515
path: data["redis.server"]
1616
value: runtime-redis:6379
1717
- equal:
1818
path: data["repo.server"]
19-
value: argo-cd-repo-server:8081
19+
value: argocd-repo-server:8081
2020

2121
- it: Argo Api Gateway Deployment should have valid matchLabel selectors
2222
template: argo-gateway/deployment.yaml

charts/gitops-runtime/tests/event-reporters_test.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,13 @@ tests:
3737
asserts:
3838
- equal:
3939
path: data["argocd.server"]
40-
value: argo-cd-server:80
40+
value: argocd-server:80
4141
- equal:
4242
path: data["redis.server"]
4343
value: runtime-redis:6379
4444
- equal:
4545
path: data["repo.server"]
46-
value: argo-cd-repo-server:8081
46+
value: argocd-repo-server:8081
4747

4848
- it: Runtime Reporter ConfigMap should have valid redis-ha url
4949
template: event-reporters/runtime-event-reporter/configmap.yaml

charts/gitops-runtime/values.yaml

Lines changed: 10 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ global:
104104
# name: argocd-token
105105
# key: token
106106
# -- Service name of the ArgoCD server
107-
svc: argo-cd-server
107+
svc: argocd-server
108108
# -- Port of the ArgoCD server
109109
port: 80
110110
# -- Set if Argo CD is running behind reverse proxy under subpath different from /
@@ -113,28 +113,9 @@ global:
113113
rootpath: ''
114114
repoServer:
115115
# -- Service name of the ArgoCD repo server
116-
svc: argo-cd-repo-server
116+
svc: argocd-repo-server
117117
# -- Port of the ArgoCD repo server
118118
port: 8081
119-
120-
# -- Configuration for external ArgoCD
121-
# Should be used when `argo-cd.enabled` is set to false
122-
external-argo-cd:
123-
# -- ArgoCD server settings
124-
server:
125-
# -- Service name of the ArgoCD server
126-
svc: argocd-server
127-
# -- Port of the ArgoCD server
128-
port: 80
129-
# -- Set if Argo CD is running behind reverse proxy under subpath different from /
130-
# e.g.
131-
# rootpath: '/argocd'
132-
rootpath: ''
133-
repoServer:
134-
# -- Service name of the ArgoCD repo server
135-
svc: argocd-repo-server
136-
# -- Port of the ArgoCD repo server
137-
port: 8081
138119
# -- Configuration for external Argo Rollouts
139120
external-argo-rollouts:
140121
# -- Rollout reporter settings
@@ -244,7 +225,13 @@ sealed-secrets:
244225
#-----------------------------------------------------------------------------------------------------------------------
245226
argo-cd:
246227
enabled: true
247-
fullnameOverride: argo-cd
228+
fullnameOverride: argocd
229+
server:
230+
name: server
231+
repoServer:
232+
name: repo-server
233+
service:
234+
port: 8081
248235
crds:
249236
install: true
250237
configs:
@@ -279,6 +266,7 @@ argo-cd:
279266
params:
280267
server.insecure: true
281268
application.namespaces: 'cf-*'
269+
server.rootpath: ''
282270
applicationVersioning:
283271
# -- Enable application versioning
284272
enabled: true

0 commit comments

Comments
 (0)