Skip to content

Commit 69c204f

Browse files
committed
feat: Print warning if resources are unset
1 parent 667d5d4 commit 69c204f

File tree

1 file changed

+47
-0
lines changed

1 file changed

+47
-0
lines changed

charts/invenio/templates/NOTES.txt

+47
Original file line numberDiff line numberDiff line change
@@ -61,3 +61,50 @@ DEPRECATION WARNING:
6161
`invenio.datacite.existingSecret` will be removed in a future release.
6262

6363
{{- end }}
64+
65+
{{/*
66+
BEGIN: Warning on unset resources.
67+
*/}}
68+
69+
{{- $fieldsToCheckForResources := list
70+
"flower"
71+
"haproxy"
72+
"kerberos.initContainers"
73+
"kerberos"
74+
"nginx"
75+
"web.initContainers"
76+
"web"
77+
"worker"
78+
"workerBeat"
79+
-}}
80+
81+
{{- $fieldsWithResourcesUnset := list -}}
82+
83+
{{- range $fieldsToCheckForResources -}}
84+
{{- $path := splitList "." . -}}
85+
{{- $values := $.Values -}}
86+
{{- range $path -}}
87+
{{- $values = index $values . -}}
88+
{{- end -}}
89+
{{- if not $values.resources -}}
90+
{{ $fieldsWithResourcesUnset = append $fieldsWithResourcesUnset . -}}
91+
{{- end -}}
92+
{{- end -}}
93+
94+
{{- with $fieldsWithResourcesUnset }}
95+
96+
💡 MISSING RESOURCES: It seems like `resources` is unset for one or more containers. We strongly recommend that you set them. The `resources` field is unset in the following places:
97+
98+
{{- "\n" -}}
99+
{{ range . }}
100+
.Values.{{ . }}
101+
{{- end }}
102+
103+
You can read more about resource management in Kubernetes here:
104+
https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/
105+
106+
{{- end }}
107+
108+
{{/*
109+
END: Warning on unset resources.
110+
*/}}

0 commit comments

Comments
 (0)