|
99 | 99 | {{- end -}}
|
100 | 100 | {{- end -}}
|
101 | 101 |
|
102 |
| -{{/* |
103 |
| -Figure out the external URL the controlplane can be reached at |
104 |
| -This endpoint is used for the CLI to know where to go for log in |
105 |
| -NOTE: Load balancer service type is not supported |
106 |
| -*/}} |
107 |
| -{{- define "chainloop.controlplane.external_url" -}} |
108 |
| -{{- $service := .Values.controlplane.service }} |
109 |
| -{{- $ingress := .Values.controlplane.ingress }} |
110 |
| - |
111 |
| -{{- if (and $ingress $ingress.enabled $ingress.hostname) }} |
112 |
| -{{- printf "%s://%s" (ternary "https" "http" $ingress.tls ) $ingress.hostname }} |
113 |
| -{{- else if (and (eq $service.type "NodePort") $service.nodePorts (not (empty $service.nodePorts.http))) }} |
114 |
| -{{- printf "http://localhost:%s" $service.nodePorts.http }} |
115 |
| -{{- else -}} |
116 |
| -null |
117 |
| -{{- end -}} |
118 |
| -{{- end -}} |
119 |
| - |
120 | 102 | {{/*
|
121 | 103 | ##############################################################################
|
122 | 104 | Controlplane helpers
|
@@ -268,6 +250,24 @@ Return the Postgresql user
|
268 | 250 | {{- end -}}
|
269 | 251 | {{- end -}}
|
270 | 252 |
|
| 253 | +{{/* |
| 254 | +Figure out the external URL the controlplane can be reached at |
| 255 | +This endpoint is used for the CLI to know where to go for log in |
| 256 | +NOTE: Load balancer service type is not supported |
| 257 | +*/}} |
| 258 | +{{- define "chainloop.controlplane.external_url" -}} |
| 259 | +{{- $service := .Values.controlplane.service }} |
| 260 | +{{- $ingress := .Values.controlplane.ingress }} |
| 261 | + |
| 262 | +{{- if (and $ingress $ingress.enabled $ingress.hostname) }} |
| 263 | +{{- printf "%s://%s" (ternary "https" "http" $ingress.tls ) $ingress.hostname }} |
| 264 | +{{- else if (and (eq $service.type "NodePort") $service.nodePorts (not (empty $service.nodePorts.http))) }} |
| 265 | +{{- printf "http://localhost:%s" $service.nodePorts.http }} |
| 266 | +{{- else -}} |
| 267 | +null |
| 268 | +{{- end -}} |
| 269 | +{{- end -}} |
| 270 | + |
271 | 271 | {{/*
|
272 | 272 | ##############################################################################
|
273 | 273 | CAS Helpers
|
@@ -316,3 +316,19 @@ Create the name of the service account to use
|
316 | 316 | {{- default "default" .Values.cas.serviceAccount.name }}
|
317 | 317 | {{- end }}
|
318 | 318 | {{- end }}
|
| 319 | + |
| 320 | +{{/* |
| 321 | +External URL the CAS can be reached at |
| 322 | +This endpoint is used for the cas to redirect downloads |
| 323 | +NOTE: Load balancer service type is not supported |
| 324 | +*/}} |
| 325 | +{{- define "chainloop.cas.external_url" -}} |
| 326 | +{{- $service := .Values.cas.service }} |
| 327 | +{{- $ingress := .Values.cas.ingress }} |
| 328 | + |
| 329 | +{{- if (and $ingress $ingress.enabled $ingress.hostname) }} |
| 330 | +{{- printf "%s://%s" (ternary "https" "http" $ingress.tls ) $ingress.hostname }} |
| 331 | +{{- else if (and (eq $service.type "NodePort") $service.nodePorts (not (empty $service.nodePorts.http))) }} |
| 332 | +{{- printf "http://localhost:%s" $service.nodePorts.http }} |
| 333 | +{{- end -}} |
| 334 | +{{- end -}} |
0 commit comments