_externalInterface.tpl 1.1 KB

1234567891011121314151617181920212223242526272829303132
  1. {{/* External Interface Spawwner */}}
  2. {{/* Call this template:
  3. {{ include "ix.v1.common.spawner.externalInterface" $ -}}
  4. */}}
  5. {{- define "ix.v1.common.spawner.externalInterface" -}}
  6. {{- range $iface := .Values.scaleExternalInterface -}}
  7. {{- include "ix.v1.common.lib.externalInterface.validation" (dict "objectData" $iface) -}}
  8. {{- end -}}
  9. {{/* Now we have validated interfaces, render the objects */}}
  10. {{- range $index, $interface := .Values.ixExternalInterfacesConfiguration -}}
  11. {{- $objectData := dict -}}
  12. {{/* Create a copy of the interface and put it in objectData.config */}}
  13. {{- $_ := set $objectData "config" (mustDeepCopy $interface) -}}
  14. {{- $objectName := (printf "ix-%s-%v" $.Release.Name $index) -}}
  15. {{/* Perform validations */}}
  16. {{- include "ix.v1.common.lib.chart.names.validation" (dict "name" $objectName) -}}
  17. {{/* Set the name of the object to objectData.name */}}
  18. {{- $_ := set $objectData "name" $objectName -}}
  19. {{/* Call class to create the object */}}
  20. {{- include "ix.v1.common.class.networkAttachmentDefinition" (dict "rootCtx" $ "objectData" $objectData) -}}
  21. {{- end -}}
  22. {{- end -}}