Skip to content

Commit e04db41

Browse files
authored
feat(deployment): support downloading redirect (#310)
Signed-off-by: Miguel Martinez Trivino <miguel@chainloop.dev>
1 parent f36a986 commit e04db41

File tree

3 files changed

+37
-20
lines changed

3 files changed

+37
-20
lines changed

deployment/chainloop/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ description: Chainloop is an open source software supply chain control plane, a
44

55
type: application
66
# Bump the patch (not minor, not major) version on each change in the Chart Source code
7-
version: 1.10.4
7+
version: 1.10.5
88
# Do not update appVersion, this is handled automatically by the release process
99
appVersion: v0.15.0
1010

deployment/chainloop/templates/_helpers.tpl

Lines changed: 34 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -99,24 +99,6 @@ null
9999
{{- end -}}
100100
{{- end -}}
101101

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-
120102
{{/*
121103
##############################################################################
122104
Controlplane helpers
@@ -268,6 +250,24 @@ Return the Postgresql user
268250
{{- end -}}
269251
{{- end -}}
270252

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+
271271
{{/*
272272
##############################################################################
273273
CAS Helpers
@@ -316,3 +316,19 @@ Create the name of the service account to use
316316
{{- default "default" .Values.cas.serviceAccount.name }}
317317
{{- end }}
318318
{{- 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 -}}

deployment/chainloop/templates/controlplane/config.configmap.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ data:
1717
server:
1818
http:
1919
addr: 0.0.0.0:8000
20-
timeout: 1s
20+
timeout: 10s
2121
external_url: {{ include "chainloop.controlplane.external_url" . }}
2222
http_metrics:
2323
addr: 0.0.0.0:5000
@@ -28,4 +28,5 @@ data:
2828
grpc:
2929
addr: {{ printf "%s-api:%.0f" (include "chainloop.cas.fullname" .) .Values.cas.serviceAPI.port }}
3030
insecure: true
31+
download_url: {{ include "chainloop.cas.external_url" . }}/download
3132
plugins_dir: {{ .Values.controlplane.pluginsDir }}

0 commit comments

Comments
 (0)