Add flag to ignore default resources for containers (#52)
This commit is contained in:
@@ -96,8 +96,10 @@ spec:
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- include "common.volumeMountsRef.tpl" . | nindent 10 }}
|
||||
{{- if not .Values.resources.ignore }}
|
||||
resources:
|
||||
{{- toYaml .Values.resources | nindent 12 }}
|
||||
{{- end }}
|
||||
{{- if .Values.sidecar }}
|
||||
- name: {{ template "robustName" .Release.Name }}-sidecar
|
||||
securityContext: *securityContext
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
suite: test deployment
|
||||
templates:
|
||||
- deployment.yaml
|
||||
- configmap.yaml
|
||||
tests:
|
||||
- it: Should render resoucres if not ignored by default
|
||||
set:
|
||||
{}
|
||||
asserts:
|
||||
- isNotNull:
|
||||
path: spec.template.spec.containers[0].resources
|
||||
- it: Should ignore resources if ignore flag is set
|
||||
set:
|
||||
resources:
|
||||
ignore: true
|
||||
asserts:
|
||||
- isNull:
|
||||
path: spec.template.spec.containers[0].resources
|
||||
@@ -226,6 +226,16 @@
|
||||
],
|
||||
"required": [],
|
||||
"properties": {
|
||||
"ignore": {
|
||||
"$id": "#/properties/resources/properties/ignore",
|
||||
"type": "boolean",
|
||||
"title": "Ignore",
|
||||
"description": "If set to true, resource configuration will be ignored",
|
||||
"default": false,
|
||||
"examples": [
|
||||
true
|
||||
]
|
||||
},
|
||||
"requests": {
|
||||
"$id": "#/properties/resources/properties/requests",
|
||||
"type": "object",
|
||||
|
||||
Reference in New Issue
Block a user