{{- /* Normalize extraObjects to a list, easier to loop over */ -}}
{{- $extraObjects := .Values.extraManifests | default (list) -}}

{{- if kindIs "map" $extraObjects -}}
  {{- $extraObjects = values $extraObjects -}}
{{- end -}}

{{- range $extraObjects }}
---
  {{- if kindIs "map" . }}
    {{- tpl (toYaml .) $ | nindent 0 }}
  {{- else if kindIs "string" . }}
    {{- tpl . $ | nindent 0 }}
  {{- end }}
{{- end }}
