2 # Copyright © 2018 Amdocs, Bell Canada
4 # Licensed under the Apache License, Version 2.0 (the "License");
5 # you may not use this file except in compliance with the License.
6 # You may obtain a copy of the License at
8 # http://www.apache.org/licenses/LICENSE-2.0
10 # Unless required by applicable law or agreed to in writing, software
11 # distributed under the License is distributed on an "AS IS" BASIS,
12 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 # See the License for the specific language governing permissions and
14 # limitations under the License.
18 Resolve the name of the common resource limit/request flavor.
19 The value for .Values.flavor is used by default,
20 unless either override mechanism is used.
22 - .Values.global.flavor : override default flavor for all charts
23 - .Values.flavorOverride : override global and default flavor on a per chart basis
25 {{- define "common.flavor" -}}
26 {{if .Values.flavorOverride }}
27 {{- printf "%s" .Values.flavorOverride -}}
29 {{- default .Values.flavor .Values.global.flavor -}}
34 Resolve the resource limit/request flavor using the desired flavor value.
36 - .Values.resources : YAML definition of resource limits. The flavor key
37 is computed based on the common.flavor template and
38 is used as the selected resource limit through the pluck
56 {{- define "common.resources" -}}
57 {{- $flavor := include "common.flavor" . -}}
58 {{- toYaml (pluck $flavor .Values.resources | first) -}}