Skip to content

Commit dc7c293

Browse files
committed
fix: Improve missing resources warning
This change improves the logic for when the warning about missing resources should be printed. Before, it printed even for disabled resources. Now, it does not print a warning for disabled resources and it dynamically checks for `initContainers` subresources. Fixes #182
1 parent 3db8070 commit dc7c293

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

charts/invenio/templates/NOTES.txt

+7-4
Original file line numberDiff line numberDiff line change
@@ -69,10 +69,8 @@ BEGIN: Warning on unset resources.
6969
{{- $fieldsToCheckForResources := list
7070
"flower"
7171
"haproxy"
72-
"kerberos.initContainers"
7372
"kerberos"
7473
"nginx"
75-
"web.initContainers"
7674
"web"
7775
"worker"
7876
"workerBeat"
@@ -86,8 +84,13 @@ BEGIN: Warning on unset resources.
8684
{{- range $path -}}
8785
{{- $values = index $values . -}}
8886
{{- end -}}
89-
{{- if not $values.resources -}}
90-
{{ $fieldsWithResourcesUnset = append $fieldsWithResourcesUnset . -}}
87+
{{- if or (not (hasKey $values "enabled")) $values.enabled -}}
88+
{{- if not $values.resources -}}
89+
{{ $fieldsWithResourcesUnset = append $fieldsWithResourcesUnset . -}}
90+
{{- end -}}
91+
{{- if (and $values.initContainers (not $values.initContainers.resources)) -}}
92+
{{ $fieldsWithResourcesUnset = append $fieldsWithResourcesUnset (print . ".initContainers") -}}
93+
{{- end -}}
9194
{{- end -}}
9295
{{- end -}}
9396

0 commit comments

Comments
 (0)