istio

Форк
0
/
zzz_profile.yaml 
34 строки · 1.3 Кб
1
{{/*
2
Complex logic ahead...
3
We have three sets of values, in order of precedence (last wins):
4
1. The builtin values.yaml defaults
5
2. The profile the user selects
6
3. Users input (-f or --set)
7

8
Unfortunately, Helm provides us (1) and (3) together (as .Values), making it hard to insert (2).
9

10
However, we can workaround this by placing all of (1) under a specific key (.Values.defaults).
11
We can then merge the profile onto the defaults, then the user settings onto that.
12
Finally, we can set all of that under .Values so the chart behaves without awareness.
13
*/}}
14
{{- $defaults := $.Values.defaults }}
15
{{- $_ := unset $.Values "defaults" }}
16
{{- $profile := dict }}
17
{{- with .Values.profile }}
18
{{- with $.Files.Get (printf "files/profile-%s.yaml" .)}}
19
{{- $profile = (. | fromYaml) }}
20
{{- else }}
21
{{ fail (cat "unknown profile" $.Values.profile) }}
22
{{- end }}
23
{{- end }}
24
{{- with .Values.compatibilityVersion }}
25
{{- with $.Files.Get (printf "files/profile-compatibility-version-%s.yaml" .) }}
26
{{- $ignore := mustMergeOverwrite $profile (. | fromYaml) }}
27
{{- else }}
28
{{ fail (cat "unknown compatibility version" $.Values.compatibilityVersion) }}
29
{{- end }}
30
{{- end }}
31
{{- if $profile }}
32
{{- $a := mustMergeOverwrite $defaults $profile }}
33
{{- end }}
34
{{- $b := set $ "Values" (mustMergeOverwrite $defaults $.Values) }}
35

Использование cookies

Мы используем файлы cookie в соответствии с Политикой конфиденциальности и Политикой использования cookies.

Нажимая кнопку «Принимаю», Вы даете АО «СберТех» согласие на обработку Ваших персональных данных в целях совершенствования нашего веб-сайта и Сервиса GitVerse, а также повышения удобства их использования.

Запретить использование cookies Вы можете самостоятельно в настройках Вашего браузера.