template dot notation fails on missing map key in confusing way
templates/resourcequota.yaml:
apiVersion: v1
kind: ResourceQuota
metadata:
name: default
spec:
hard:
{{- if .resourceQuota.hard.cpu }}
cpu: {{ .resourceQuota.hard.cpu }}
{{- else }}
cpu: "1"
{{- end}}
ERROR: error (ExecError) evaluating the template named 'templates/resourcequota.yaml': template: templates/resourcequota.yaml:8:25: executing "templates/resourcequota.yaml" at <.resourceQuota.hard....>: map has no entry for key "resourceQuota"
TODO:
- add
--unsafe-ignore-missing-keysas a workaround - add a dict/map function that will work with default map key option