File tree Expand file tree Collapse file tree 6 files changed +36
-7
lines changed Expand file tree Collapse file tree 6 files changed +36
-7
lines changed Original file line number Diff line number Diff line change @@ -135,3 +135,16 @@ Generate path for twig storage emptyDir
135135{{- define "nginx-php-persistent.twig-storage.path" -}}
136136{{- printf "%s/php" .Values.persistentStorage.path }}
137137{{- end -}}
138+
139+ {{/*
140+ Merge resources from global over resources defined in the values
141+ */}}
142+ {{- define "resources" -}}
143+ {{- $value := dict -}}
144+ {{- range (rest .) -}}
145+ {{- $value = merge $value . -}}
146+ {{- end -}}
147+ {{- if $value -}}
148+ {{- toYaml $value }}
149+ {{- end }}
150+ {{- end -}}
Original file line number Diff line number Diff line change @@ -109,8 +109,7 @@ spec:
109109 {{- toYaml .Values.dynamicSecretMounts | nindent 12 }}
110110 {{- end }}
111111 resources :
112- {{- toYaml .Values.resources.nginx | nindent 12 }}
113-
112+ {{- include "resources" (list "resources" .Values.resources .Values.containerResources.nginx) | nindent 12 }}
114113 - image : {{ .Values.images.php | quote }}
115114 name : " php"
116115 imagePullPolicy : {{ .Values.imagePullPolicy }}
@@ -146,7 +145,7 @@ spec:
146145 {{- toYaml .Values.dynamicSecretMounts | nindent 12 }}
147146 {{- end }}
148147 resources :
149- {{- toYaml .Values.resources. php | nindent 12 }}
148+ {{- include "resources" (list "resources" .Values.resources .Values.containerResources. php ) | nindent 12 }}
150149 {{- with .Values.nodeSelector }}
151150 nodeSelector :
152151 {{- toYaml . | nindent 8 }}
Original file line number Diff line number Diff line change @@ -40,7 +40,7 @@ fastly:
4040# serviceId: ''
4141# apiSecretName: ''
4242
43- resources :
43+ containerResources :
4444 nginx :
4545 # limits:
4646 # cpu: 100m
@@ -56,6 +56,8 @@ resources:
5656 cpu : 10m
5757 memory : 100Mi
5858
59+ resources : {}
60+
5961nodeSelector : {}
6062
6163cronjobNodeSelector : {}
Original file line number Diff line number Diff line change @@ -113,3 +113,16 @@ lagoon.sh/prHeadBranch: {{ .Values.prHeadBranch | quote }}
113113lagoon.sh/prBaseBranch: { { .Values.prBaseBranch | quote } }
114114{ {- end } }
115115{ {- end -} }
116+
117+ { {/*
118+ Merge resources from global over resources defined in the values
119+ */} }
120+ { {- define " resources" -} }
121+ { {- $value := dict -} }
122+ { {- range (rest .) -} }
123+ { {- $value = merge $value . -} }
124+ { {- end -} }
125+ { {- if $value -} }
126+ { {- toYaml $value } }
127+ { {- end } }
128+ { {- end -} }
Original file line number Diff line number Diff line change 7272 - configMapRef :
7373 name : lagoon-env
7474 resources :
75- {{- toYaml .Values.resources. nginx | nindent 12 }}
75+ {{- include "resources" (list "resources" .Values.resources .Values.containerResources. nginx ) | nindent 12 }}
7676 {{- if .Values.dynamicSecretMounts }}
7777 volumeMounts :
7878 {{- toYaml .Values.dynamicSecretMounts | nindent 12 }}
@@ -105,7 +105,7 @@ spec:
105105 - name : NGINX_FASTCGI_PASS
106106 value : ' 127.0.0.1'
107107 resources :
108- {{- toYaml .Values.resources. php | nindent 12 }}
108+ {{- include "resources" (list "resources" .Values.resources .Values.containerResources. php ) | nindent 12 }}
109109 {{- if .Values.dynamicSecretMounts }}
110110 volumeMounts :
111111 {{- toYaml .Values.dynamicSecretMounts | nindent 12 }}
Original file line number Diff line number Diff line change @@ -37,7 +37,7 @@ fastly:
3737# serviceId: ''
3838# apiSecretName: ''
3939
40- resources :
40+ containerResources :
4141 nginx :
4242 # limits:
4343 # cpu: 100m
@@ -53,6 +53,8 @@ resources:
5353 cpu : 10m
5454 memory : 100Mi
5555
56+ resources : {}
57+
5658nodeSelector : {}
5759
5860cronjobNodeSelector : {}
You can’t perform that action at this time.
0 commit comments