helm-charts/charts/library/common/templates/render/_rawResources.tpl
Bernd Schorgers 90e6b9e7cf
feat(common): Release 3.5.0 (#357)
Co-authored-by: Lawrence Gil <lawrence.gil@assemblyglobal.com>
2024-10-04 13:50:55 +00:00

28 lines
1.1 KiB
Smarty

{{/*
Renders other arbirtrary objects required by the chart.
*/}}
{{- define "bjw-s.common.render.rawResources" -}}
{{- $rootContext := $ -}}
{{- /* Generate raw resources as required */ -}}
{{- range $key, $resource := .Values.rawResources -}}
{{- /* Enable by default, but allow override */ -}}
{{- $resourceEnabled := true -}}
{{- if hasKey $resource "enabled" -}}
{{- $resourceEnabled = $resource.enabled -}}
{{- end -}}
{{- if $resourceEnabled -}}
{{- $resourceValues := (mustDeepCopy $resource) -}}
{{- /* Create object from the raw resource values */ -}}
{{- $resourceObject := (include "bjw-s.common.lib.valuesToObject" (dict "rootContext" $rootContext "id" $key "values" $resourceValues)) | fromYaml -}}
{{- /* Perform validations on the resource before rendering */ -}}
{{- include "bjw-s.common.lib.rawResource.validate" (dict "rootContext" $ "object" $resourceValues) -}}
{{- /* Include the raw resource class */ -}}
{{- include "bjw-s.common.class.rawResource" (dict "rootContext" $ "object" $resourceValues) | nindent 0 -}}
{{- end -}}
{{- end -}}
{{- end -}}