Skip to content

Commit f6231af

Browse files
committed
feat: add extra deploy to help chart
1 parent ceebf66 commit f6231af

File tree

3 files changed

+33
-0
lines changed

3 files changed

+33
-0
lines changed

helm/overleash/templates/_helpers.tpl

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,4 +66,29 @@ Allow the release namespace to be overridden for multi-namespace deployments in
6666
*/}}
6767
{{- define "overleash.namespace" -}}
6868
{{- default .Release.Namespace .Values.namespaceOverride | trunc 63 | trimSuffix "-" -}}
69+
{{- end -}}
70+
71+
72+
{{/*
73+
Copyright Broadcom, Inc. All Rights Reserved.
74+
SPDX-License-Identifier: APACHE-2.0
75+
*/}}
76+
77+
{{/*
78+
Renders a value that contains template perhaps with scope if the scope is present.
79+
Usage:
80+
{{ include "common.tplvalues.render" ( dict "value" .Values.path.to.the.Value "context" $ ) }}
81+
{{ include "common.tplvalues.render" ( dict "value" .Values.path.to.the.Value "context" $ "scope" $app ) }}
82+
*/}}
83+
{{- define "overleash.tplvalues.render" -}}
84+
{{- $value := typeIs "string" .value | ternary .value (.value | toYaml) }}
85+
{{- if contains "{{" (toJson .value) }}
86+
{{- if .scope }}
87+
{{- tpl (cat "{{- with $.RelativeScope -}}" $value "{{- end }}") (merge (dict "RelativeScope" .scope) .context) }}
88+
{{- else }}
89+
{{- tpl $value .context }}
90+
{{- end }}
91+
{{- else }}
92+
{{- $value }}
93+
{{- end }}
6994
{{- end -}}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{{- range .Values.extraDeploy }}
2+
---
3+
{{ include "overleash.tplvalues.render" (dict "value" . "context" $) }}
4+
{{- end }}

helm/overleash/values.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,10 @@ persistence:
130130
##
131131
annotations: {}
132132

133+
## @param extraDeploy Array with extra yaml to deploy with the chart. Evaluated as a template
134+
##
135+
extraDeploy: []
136+
133137
extraEnv:
134138
OVERLEASH_UPSTREAM: ""
135139
OVERLEASH_TOKEN: ""

0 commit comments

Comments
 (0)