Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 20 additions & 1 deletion charts/flagger/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,23 @@ Create the name of the service account to use
{{- else -}}
{{ default "default" .Values.serviceAccount.name }}
{{- end -}}
{{- end -}}
{{- end -}}

{{/*
Renders a value that contains template perhaps with scope if the scope is present.
Usage:
{{ include "flagger.render" ( dict "value" .Values.path.to.the.Value "context" $ ) }}
{{ include "flagger.render" ( dict "value" .Values.path.to.the.Value "context" $ "scope" $app ) }}
*/}}
{{- define "flagger.render" -}}
{{- $value := typeIs "string" .value | ternary .value (.value | toYaml) }}
{{- if contains "{{" (toJson .value) }}
{{- if .scope }}
{{- tpl (cat "{{- with $.RelativeScope -}}" $value "{{- end }}") (merge (dict "RelativeScope" .scope) .context) }}
{{- else }}
{{- tpl $value .context }}
{{- end }}
{{- else }}
{{- $value }}
{{- end }}
{{- end -}}
4 changes: 4 additions & 0 deletions charts/flagger/templates/extra-deploy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{{- range .Values.extraDeploy }}
---
{{ include "flagger.render" (dict "value" . "context" $) }}
{{- end }}
3 changes: 3 additions & 0 deletions charts/flagger/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -207,3 +207,6 @@ noCrossNamespaceRefs: false
additionalVolumes: {}
# - name: tmpfs
# emptyDir: {}

# Array of extra objects to deploy with the release
extraDeploy: []
19 changes: 19 additions & 0 deletions charts/grafana/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,22 @@ Create chart name and version as used by the chart label.
{{- define "grafana.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}}
{{- end -}}

{{/*
Renders a value that contains template perhaps with scope if the scope is present.
Usage:
{{ include "grafana.render" ( dict "value" .Values.path.to.the.Value "context" $ ) }}
{{ include "grafana.render" ( dict "value" .Values.path.to.the.Value "context" $ "scope" $app ) }}
*/}}
{{- define "grafana.render" -}}
{{- $value := typeIs "string" .value | ternary .value (.value | toYaml) }}
{{- if contains "{{" (toJson .value) }}
{{- if .scope }}
{{- tpl (cat "{{- with $.RelativeScope -}}" $value "{{- end }}") (merge (dict "RelativeScope" .scope) .context) }}
{{- else }}
{{- tpl $value .context }}
{{- end }}
{{- else }}
{{- $value }}
{{- end }}
{{- end -}}
4 changes: 4 additions & 0 deletions charts/grafana/templates/extra-deploy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{{- range .Values.extraDeploy }}
---
{{ include "grafana.render" (dict "value" . "context" $) }}
{{- end }}
3 changes: 3 additions & 0 deletions charts/grafana/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,6 @@ url: http://prometheus:9090

# Weave Cloud instance token
token:

# Array of extra objects to deploy with the release
extraDeploy: []
19 changes: 19 additions & 0 deletions charts/loadtester/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,22 @@ Create chart name and version as used by the chart label.
{{- define "loadtester.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}}
{{- end -}}

{{/*
Renders a value that contains template perhaps with scope if the scope is present.
Usage:
{{ include "loadtester.render" ( dict "value" .Values.path.to.the.Value "context" $ ) }}
{{ include "loadtester.render" ( dict "value" .Values.path.to.the.Value "context" $ "scope" $app ) }}
*/}}
{{- define "loadtester.render" -}}
{{- $value := typeIs "string" .value | ternary .value (.value | toYaml) }}
{{- if contains "{{" (toJson .value) }}
{{- if .scope }}
{{- tpl (cat "{{- with $.RelativeScope -}}" $value "{{- end }}") (merge (dict "RelativeScope" .scope) .context) }}
{{- else }}
{{- tpl $value .context }}
{{- end }}
{{- else }}
{{- $value }}
{{- end }}
{{- end -}}
4 changes: 4 additions & 0 deletions charts/loadtester/templates/extra-deploy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{{- range .Values.extraDeploy }}
---
{{ include "loadtester.render" (dict "value" . "context" $) }}
{{- end }}
3 changes: 3 additions & 0 deletions charts/loadtester/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -100,3 +100,6 @@ podSecurityContext:
podDisruptionBudget:
enabled: false
minAvailable: 1

# Array of extra objects to deploy with the release
extraDeploy: []
21 changes: 20 additions & 1 deletion charts/podinfo/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,23 @@ Create chart name suffix.
{{- else -}}
{{- "" -}}
{{- end -}}
{{- end -}}
{{- end -}}

{{/*
Renders a value that contains template perhaps with scope if the scope is present.
Usage:
{{ include "podinfo.render" ( dict "value" .Values.path.to.the.Value "context" $ ) }}
{{ include "podinfo.render" ( dict "value" .Values.path.to.the.Value "context" $ "scope" $app ) }}
*/}}
{{- define "podinfo.render" -}}
{{- $value := typeIs "string" .value | ternary .value (.value | toYaml) }}
{{- if contains "{{" (toJson .value) }}
{{- if .scope }}
{{- tpl (cat "{{- with $.RelativeScope -}}" $value "{{- end }}") (merge (dict "RelativeScope" .scope) .context) }}
{{- else }}
{{- tpl $value .context }}
{{- end }}
{{- else }}
{{- $value }}
{{- end }}
{{- end -}}
4 changes: 4 additions & 0 deletions charts/podinfo/templates/extra-deploy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{{- range .Values.extraDeploy }}
---
{{ include "podinfo.render" (dict "value" . "context" $) }}
{{- end }}
3 changes: 3 additions & 0 deletions charts/podinfo/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -81,3 +81,6 @@ faults:

httpServer:
timeout: 30s

# Array of extra objects to deploy with the release
extraDeploy: []