File tree Expand file tree Collapse file tree 3 files changed +17
-8
lines changed Expand file tree Collapse file tree 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
135135Determine argocd server url. Must be called with chart root context
136136*/} }
137137{ {- define " codefresh-gitops-runtime.argocd.server.url" -} }
138- { {- $argoCDValues := (get .Values " argo-cd" ) } }
139138{ {- $protocol := " https" } }
140- { {- $serverName := include " codefresh-gitops-runtime.argocd.server.servicename" . } }
141139{ {- $port := include " codefresh-gitops-runtime.argocd.server.serviceport" . } }
142- { {- $path := (get $argoCDValues .configs.params " server.rootpath" ) } }
143140{ {- if (eq $port " 80" ) } }
144141 { {- $protocol = " http" } }
145142{ {- 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 } }
147156{ {- end} }
148157
149158{ {/*
Original file line number Diff line number Diff line change 1818
1919 {{/* Set argo-cd-server service and port */}}
2020 {{ 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" . ) }}
2222 {{- end }}
2323
2424 {{/* Set workflows url */}}
Original file line number Diff line number Diff line change @@ -329,7 +329,7 @@ tests:
329329 path : spec.template.spec.containers[1].env
330330 content :
331331 name : ARGO_CD_URL
332- value : http:// myargocd-server:80/some-path
332+ value : myargocd-server:80/some-path
333333
334334- it : contains all resources for notifications controller
335335 template : gitops-operator.yaml
@@ -371,11 +371,11 @@ tests:
371371 argo-cd.configs.params :
372372 server.rootpath : /some-path
373373 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
375375 asserts :
376376 - contains :
377377 path : spec.template.spec.containers[1].env
378378 content :
379379 name : ARGO_CD_URL
380- value : http:// some-other-url
380+ value : some-other-url:123
381381
You can’t perform that action at this time.
0 commit comments