@@ -93,48 +93,28 @@ Determine argocd redis service name. Must be called with chart root context
9393Determine argocd repo server service name. Must be called with chart root context
9494*/} }
9595{ {- define " codefresh-gitops-runtime.argocd.reposerver.servicename" -} }
96- { {/* For now use template from ArgoCD chart until better approach */} }
97- { {- if (index .Subcharts " argo-cd" ) } }
98- { {- template " argo-cd.repoServer.fullname" (dict " Values" (get .Values " argo-cd" ) " Release" .Release ) } }
99- { {- else } }
100- { {- $repoServer := index .Values " global" " external-argo-cd" " repoServer" } }
101- { {- $svc := required " ArgoCD is not enabled and .Values.global.external-argo-cd.repoServer.svc is not set" $repoServer .svc } }
102- { {- printf " %s" $svc } }
103- { {- end } }
96+ { {- $repoServer := index .Values " global" " integrations" " argo-cd" " repoServer" } }
97+ { {- $svc := required " .Values.global.integrations.argo-cd.repoServer.svc is not set" $repoServer .svc } }
98+ { {- printf " %s" $svc } }
10499{ {- end } }
105100
106101{ {/*
107102Determine argocd argocd repo server port
108103*/} }
109104{ {- define " codefresh-gitops-runtime.argocd.reposerver.serviceport" -} }
110- { {/* For now use template from ArgoCD chart until better approach */} }
111- { {- if (index .Subcharts " argo-cd" ) } }
112- { {- index .Values " argo-cd" " repoServer" " service" " port" } }
113- { {- else } }
114- { {- $repoServer := index .Values " global" " external-argo-cd" " repoServer" } }
115- { {- $port := required " ArgoCD is not enabled and .Values.global.external-argo-cd.repoServer.svc is not set" $repoServer .port } }
116- { {- printf " %v" $port } }
117- { {- end } }
105+ { {- $repoServer := index .Values " global" " integrations" " argo-cd" " repoServer" } }
106+ { {- $port := required " .Values.global.integrations.argo-cd.repoServer.svc is not set" $repoServer .port } }
107+ { {- printf " %v" $port } }
118108{ {- end } }
119109
120110
121111{ {/*
122112Determine argocd repoServer url
123113*/} }
124114{ {- define " codefresh-gitops-runtime.argocd.reposerver.url" -} }
125- { {- $argoCDValues := (get .Values " argo-cd" ) } }
126- { {- if (index .Values " argo-cd" " enabled" ) } }
127- { {- $serviceName := include " codefresh-gitops-runtime.argocd.reposerver.servicename" . } }
128- { {- $port := include " codefresh-gitops-runtime.argocd.reposerver.serviceport" . } }
129- { {- printf " %s:%s" $serviceName $port } }
130- { {- else if (index .Values " global" " external-argo-cd" " repoServer" ) } }
131- { {- $repoServer := (index .Values " global" " external-argo-cd" " repoServer" ) } }
132- { {- $svc := required " ArgoCD is not enabled and .Values.global.external-argo-cd.repoServer.svc is not set" $repoServer .svc } }
133- { {- $port := required " ArgoCD is not enabled and .Values.global.external-argo-cd.repoServer.port is not set" $repoServer .port } }
134- { {- printf " %s:%v" $svc $port } }
135- { {- else } }
136- { {- fail " ArgoCD is not enabled and .Values.global.external-argo-cd.repoServer is not set" } }
137- { {- end } }
115+ { {- $repoServer := (index .Values " global" " integrations" " argo-cd" " repoServer" ) } }
116+ { {- $svc := required " .Values.global.integrations.argo-cd.repoServer.svc is not set" $repoServer .svc } }
117+ { {- $port := required " .Values.global.integrations.argo-cd.repoServer.port is not set" $repoServer .port } }
138118{ {- end} }
139119
140120
@@ -190,49 +170,27 @@ Determine argocd redis service port. Must be called with chart root context
190170Determine argocd server url. Must be called with chart root context
191171*/} }
192172{ {- define " codefresh-gitops-runtime.argocd.server.url" -} }
193- { {- if (index .Values " argo-cd" " enabled" ) } }
194- { {- $protocol := " https" } }
195- { {- $port := include " codefresh-gitops-runtime.argocd.server.serviceport" . } }
196- { {- if (eq $port " 80" ) } }
197- { {- $protocol = " http" } }
198- { {- end } }
199- { {- $url := include " codefresh-gitops-runtime.argocd.server.no-protocol-url" . } }
200- { {- printf " %s://%s" $protocol $url } }
201- { {- else if (index .Values " global" " external-argo-cd" " server" ) } }
202- { {- $argoCDSrv := (index .Values " global" " external-argo-cd" " server" ) } }
203- { {- $protocol := " http" } }
204- { {- $svc := required " ArgoCD is not enabled and .Values.global.external-argo-cd.server.svc is not set" $argoCDSrv .svc } }
205- { {- $port := (required " ArgoCD is not enabled and .Values.global.external-argo-cd.server.port is not port" $argoCDSrv .port) | toString } }
206- { {- $rootpath := (index .Values " global" " external-argo-cd" " server" " rootpath" ) } }
207- { {- if (eq $port " 80" ) } }
208- { {- printf " %s://%s%s" $protocol $svc $rootpath } }
209- { {- else } }
210- { {- printf " %s://%s:%s%s" $protocol $svc $port $rootpath } }
211- { {- end } }
173+ { {- $argoCDSrv := (index .Values " global" " integrations" " argo-cd" " server" ) } }
174+ { {- $protocol := " http" } }
175+ { {- $svc := required " .Values.global.integrations.argo-cd.server.svc is not set" $argoCDSrv .svc } }
176+ { {- $port := (required " .Values.global.integrations.argo-cd.server.port is not set" $argoCDSrv .port) | toString } }
177+ { {- $rootpath := (index .Values " global" " integrations" " argo-cd" " server" " rootpath" ) } }
178+ { {- if (eq $port " 80" ) } }
179+ { {- printf " %s://%s%s" $protocol $svc $rootpath } }
212180 { {- else } }
213- { {- fail " ArgoCD is not enabled and .Values.global.external-argo-cd.server is not set " } }
181+ { {- printf " %s://%s:%s%s " $ protocol $ svc $ port $ rootpath } }
214182 { {- end } }
215183{ {- end} }
216184
217185{ {/*
218186Determine argocd server url witout the protocol. Must be called with chart root context
219187*/} }
220188{ {- define " codefresh-gitops-runtime.argocd.server.no-protocol-url" -} }
221- { {- $argoCDValues := (get .Values " argo-cd" ) } }
222- { {- if (index .Values " argo-cd" " enabled" ) } }
223- { {- $serverName := include " codefresh-gitops-runtime.argocd.server.servicename" . } }
224- { {- $port := include " codefresh-gitops-runtime.argocd.server.serviceport" . } }
225- { {- $path := (get $argoCDValues .configs.params " server.rootpath" ) } }
226- { {- printf " %s:%s%s" $serverName $port $path } }
227- { {- else if (index .Values " global" " external-argo-cd" " server" ) } }
228- { {- $argoCDSrv := (index .Values " global" " external-argo-cd" " server" ) } }
229- { {- $svc := required " ArgoCD is not enabled and .Values.global.external-argo-cd.server.svc is not set" $argoCDSrv .svc } }
230- { {- $port := required " ArgoCD is not enabled and .Values.global.external-argo-cd.server.port is not set" $argoCDSrv .port } }
231- { {- $rootpath := (index .Values " global" " external-argo-cd" " server" " rootpath" ) } }
189+ { {- $argoCDSrv := (index .Values " global" " integrations" " argo-cd" " server" ) } }
190+ { {- $svc := required " ArgoCD is not enabled and .Values.global.integrations.argo-cd.server.svc is not set" $argoCDSrv .svc } }
191+ { {- $port := required " ArgoCD is not enabled and .Values.global.integrations.argo-cd.server.port is not set" $argoCDSrv .port } }
192+ { {- $rootpath := (index .Values " global" " integrations" " argo-cd" " server" " rootpath" ) } }
232193 { {- printf " %s:%v%s" $svc $port $rootpath } }
233- { {- else } }
234- { {- fail " ArgoCD is not enabled and .Values.global.external-argo-cd.server is not set" } }
235- { {- end } }
236194{ {- end} }
237195
238196{ {- define " codefresh-gitops-runtime.argocd-auth" -} }
0 commit comments