istio.io/istio@v0.0.0-20240520182934-d79c90f27776/manifests/charts/gateway/templates/zzz_profile.yaml (about)

     1  {{/*
     2  WARNING: DO NOT EDIT, THIS FILE IS A PROBABLY COPY.
     3  The original version of this file is located at /manifests directory.
     4  If you want to make a change in this file, edit the original one and run "make gen".
     5  
     6  Complex logic ahead...
     7  We have three sets of values, in order of precedence (last wins):
     8  1. The builtin values.yaml defaults
     9  2. The profile the user selects
    10  3. Users input (-f or --set)
    11  
    12  Unfortunately, Helm provides us (1) and (3) together (as .Values), making it hard to insert (2).
    13  
    14  However, we can workaround this by placing all of (1) under a specific key (.Values.defaults).
    15  We can then merge the profile onto the defaults, then the user settings onto that.
    16  Finally, we can set all of that under .Values so the chart behaves without awareness.
    17  */}}
    18  {{- $defaults := $.Values.defaults }}
    19  {{- $_ := unset $.Values "defaults" }}
    20  {{- $profile := dict }}
    21  {{- with .Values.profile }}
    22  {{- with $.Files.Get (printf "files/profile-%s.yaml" .)}}
    23  {{- $profile = (. | fromYaml) }}
    24  {{- else }}
    25  {{ fail (cat "unknown profile" $.Values.profile) }}
    26  {{- end }}
    27  {{- end }}
    28  {{- with .Values.compatibilityVersion }}
    29  {{- with $.Files.Get (printf "files/profile-compatibility-version-%s.yaml" .) }}
    30  {{- $ignore := mustMergeOverwrite $profile (. | fromYaml) }}
    31  {{- else }}
    32  {{ fail (cat "unknown compatibility version" $.Values.compatibilityVersion) }}
    33  {{- end }}
    34  {{- end }}
    35  {{- if $profile }}
    36  {{- $a := mustMergeOverwrite $defaults $profile }}
    37  {{- end }}
    38  {{- $b := set $ "Values" (mustMergeOverwrite $defaults $.Values) }}