File tree 3 files changed +17
-8
lines changed
3 files changed +17
-8
lines changed Original file line number Diff line number Diff line change @@ -135,15 +135,24 @@ Determine argocd server service port. Must be called with chart root context
135
135
Determine argocd server url. Must be called with chart root context
136
136
*/} }
137
137
{ {- define " codefresh-gitops-runtime.argocd.server.url" -} }
138
- { {- $argoCDValues := (get .Values " argo-cd" ) } }
139
138
{ {- $protocol := " https" } }
140
- { {- $serverName := include " codefresh-gitops-runtime.argocd.server.servicename" . } }
141
139
{ {- $port := include " codefresh-gitops-runtime.argocd.server.serviceport" . } }
142
- { {- $path := (get $argoCDValues .configs.params " server.rootpath" ) } }
143
140
{ {- if (eq $port " 80" ) } }
144
141
{ {- $protocol = " http" } }
145
142
{ {- end } }
146
- { {- printf " %s://%s:%s%s" $protocol $serverName $port $path } }
143
+ { {- $url := include " codefresh-gitops-runtime.argocd.server.no-protocol-url" . } }
144
+ { {- printf " %s://%s" $protocol $url } }
145
+ { {- end} }
146
+
147
+ { {/*
148
+ Determine argocd server url witout the protocol. Must be called with chart root context
149
+ */} }
150
+ { {- define " codefresh-gitops-runtime.argocd.server.no-protocol-url" -} }
151
+ { {- $argoCDValues := (get .Values " argo-cd" ) } }
152
+ { {- $serverName := include " codefresh-gitops-runtime.argocd.server.servicename" . } }
153
+ { {- $port := include " codefresh-gitops-runtime.argocd.server.serviceport" . } }
154
+ { {- $path := (get $argoCDValues .configs.params " server.rootpath" ) } }
155
+ { {- printf " %s:%s%s" $serverName $port $path } }
147
156
{ {- end} }
148
157
149
158
{ {/*
Original file line number Diff line number Diff line change 18
18
19
19
{{/* Set argo-cd-server service and port */}}
20
20
{{ if not (index .Values "gitops-operator").env.ARGO_CD_URL }}
21
- {{- $_ := set $gitopsOperatorContext.Values.env "ARGO_CD_URL" (include "codefresh-gitops-runtime.argocd.server.url" . ) }}
21
+ {{- $_ := set $gitopsOperatorContext.Values.env "ARGO_CD_URL" (include "codefresh-gitops-runtime.argocd.server.no-protocol- url" . ) }}
22
22
{{- end }}
23
23
24
24
{{/* Set workflows url */}}
Original file line number Diff line number Diff line change @@ -329,7 +329,7 @@ tests:
329
329
path : spec.template.spec.containers[1].env
330
330
content :
331
331
name : ARGO_CD_URL
332
- value : http:// myargocd-server:80/some-path
332
+ value : myargocd-server:80/some-path
333
333
334
334
- it : contains all resources for notifications controller
335
335
template : gitops-operator.yaml
@@ -371,11 +371,11 @@ tests:
371
371
argo-cd.configs.params :
372
372
server.rootpath : /some-path
373
373
argo-cd.fullnameOverride : myargocd
374
- gitops-operator.env.ARGO_CD_URL : http:// some-other-url
374
+ gitops-operator.env.ARGO_CD_URL : some-other-url:123
375
375
asserts :
376
376
- contains :
377
377
path : spec.template.spec.containers[1].env
378
378
content :
379
379
name : ARGO_CD_URL
380
- value : http:// some-other-url
380
+ value : some-other-url:123
381
381
You can’t perform that action at this time.
0 commit comments