File tree Expand file tree Collapse file tree 12 files changed +106
-2
lines changed Expand file tree Collapse file tree 12 files changed +106
-2
lines changed Original file line number Diff line number Diff line change @@ -39,4 +39,23 @@ Create the name of the service account to use
3939{ {- else -} }
4040 { { default " default" .Values.serviceAccount.name } }
4141{ {- end -} }
42- { {- end -} }
42+ { {- end -} }
43+
44+ { {/*
45+ Renders a value that contains template perhaps with scope if the scope is present.
46+ Usage:
47+ {{ include " flagger.render" ( dict " value" .Values.path.to.the.Value " context" $ ) } }
48+ { { include " flagger.render" ( dict " value" .Values.path.to.the.Value " context" $ " scope" $app ) } }
49+ */}}
50+ { {- define " flagger.render" -} }
51+ { {- $value := typeIs " string" .value | ternary .value (.value | toYaml) } }
52+ { {- if contains " {{" (toJson .value) } }
53+ { {- if .scope } }
54+ { {- tpl (cat " {{- with $.RelativeScope -}}" $value " {{- end }}" ) (merge (dict " RelativeScope" .scope) .context) } }
55+ { {- else } }
56+ { {- tpl $value .context } }
57+ { {- end } }
58+ { {- else } }
59+ { {- $value } }
60+ { {- end } }
61+ { {- end -} }
Original file line number Diff line number Diff line change 1+ {{- range .Values.extraDeploy }}
2+ ---
3+ {{ include "flagger.render" (dict "value" . "context" $) }}
4+ {{- end }}
Original file line number Diff line number Diff line change @@ -207,3 +207,6 @@ noCrossNamespaceRefs: false
207207additionalVolumes : {}
208208 # - name: tmpfs
209209 # emptyDir: {}
210+
211+ # Array of extra objects to deploy with the release
212+ extraDeploy : []
Original file line number Diff line number Diff line change @@ -30,3 +30,22 @@ Create chart name and version as used by the chart label.
3030{ {- define " grafana.chart" -} }
3131{ {- printf " %s-%s" .Chart.Name .Chart.Version | replace " +" " _" | trunc 63 | trimSuffix " -" -} }
3232{ {- end -} }
33+
34+ { {/*
35+ Renders a value that contains template perhaps with scope if the scope is present.
36+ Usage:
37+ {{ include " grafana.render" ( dict " value" .Values.path.to.the.Value " context" $ ) } }
38+ { { include " grafana.render" ( dict " value" .Values.path.to.the.Value " context" $ " scope" $app ) } }
39+ */}}
40+ { {- define " grafana.render" -} }
41+ { {- $value := typeIs " string" .value | ternary .value (.value | toYaml) } }
42+ { {- if contains " {{" (toJson .value) } }
43+ { {- if .scope } }
44+ { {- tpl (cat " {{- with $.RelativeScope -}}" $value " {{- end }}" ) (merge (dict " RelativeScope" .scope) .context) } }
45+ { {- else } }
46+ { {- tpl $value .context } }
47+ { {- end } }
48+ { {- else } }
49+ { {- $value } }
50+ { {- end } }
51+ { {- end -} }
Original file line number Diff line number Diff line change 1+ {{- range .Values.extraDeploy }}
2+ ---
3+ {{ include "grafana.render" (dict "value" . "context" $) }}
4+ {{- end }}
Original file line number Diff line number Diff line change @@ -37,3 +37,6 @@ url: http://prometheus:9090
3737
3838# Weave Cloud instance token
3939token :
40+
41+ # Array of extra objects to deploy with the release
42+ extraDeploy : []
Original file line number Diff line number Diff line change @@ -30,3 +30,22 @@ Create chart name and version as used by the chart label.
3030{ {- define " loadtester.chart" -} }
3131{ {- printf " %s-%s" .Chart.Name .Chart.Version | replace " +" " _" | trunc 63 | trimSuffix " -" -} }
3232{ {- end -} }
33+
34+ { {/*
35+ Renders a value that contains template perhaps with scope if the scope is present.
36+ Usage:
37+ {{ include " loadtester.render" ( dict " value" .Values.path.to.the.Value " context" $ ) } }
38+ { { include " loadtester.render" ( dict " value" .Values.path.to.the.Value " context" $ " scope" $app ) } }
39+ */}}
40+ { {- define " loadtester.render" -} }
41+ { {- $value := typeIs " string" .value | ternary .value (.value | toYaml) } }
42+ { {- if contains " {{" (toJson .value) } }
43+ { {- if .scope } }
44+ { {- tpl (cat " {{- with $.RelativeScope -}}" $value " {{- end }}" ) (merge (dict " RelativeScope" .scope) .context) } }
45+ { {- else } }
46+ { {- tpl $value .context } }
47+ { {- end } }
48+ { {- else } }
49+ { {- $value } }
50+ { {- end } }
51+ { {- end -} }
Original file line number Diff line number Diff line change 1+ {{- range .Values.extraDeploy }}
2+ ---
3+ {{ include "loadtester.render" (dict "value" . "context" $) }}
4+ {{- end }}
Original file line number Diff line number Diff line change @@ -94,3 +94,6 @@ securityContext:
9494podDisruptionBudget :
9595 enabled : false
9696 minAvailable : 1
97+
98+ # Array of extra objects to deploy with the release
99+ extraDeploy : []
Original file line number Diff line number Diff line change @@ -40,4 +40,23 @@ Create chart name suffix.
4040{ {- else -} }
4141{ {- " " -} }
4242{ {- end -} }
43- { {- end -} }
43+ { {- end -} }
44+
45+ { {/*
46+ Renders a value that contains template perhaps with scope if the scope is present.
47+ Usage:
48+ {{ include " podinfo.render" ( dict " value" .Values.path.to.the.Value " context" $ ) } }
49+ { { include " podinfo.render" ( dict " value" .Values.path.to.the.Value " context" $ " scope" $app ) } }
50+ */}}
51+ { {- define " podinfo.render" -} }
52+ { {- $value := typeIs " string" .value | ternary .value (.value | toYaml) } }
53+ { {- if contains " {{" (toJson .value) } }
54+ { {- if .scope } }
55+ { {- tpl (cat " {{- with $.RelativeScope -}}" $value " {{- end }}" ) (merge (dict " RelativeScope" .scope) .context) } }
56+ { {- else } }
57+ { {- tpl $value .context } }
58+ { {- end } }
59+ { {- else } }
60+ { {- $value } }
61+ { {- end } }
62+ { {- end -} }
You can’t perform that action at this time.
0 commit comments