_networkAttachmentDefinition.tpl 1.3 KB

12345678910111213141516171819202122232425262728293031323334
  1. {{/* Network Attachment Definition Class */}}
  2. {{/* Call this template:
  3. {{ include "ix.v1.common.class.networkAttachmentDefinition" (dict "rootCtx" $ "objectData" $objectData) }}
  4. rootCtx: The root context of the chart.
  5. objectData:
  6. name: The name of the Network Attachment Definition.
  7. labels: The labels of the Network Attachment Definition.
  8. annotations: The annotations of the Network Attachment Definition.
  9. config: The config of the interface
  10. */}}
  11. {{- define "ix.v1.common.class.networkAttachmentDefinition" -}}
  12. {{- $rootCtx := .rootCtx -}}
  13. {{- $objectData := .objectData }}
  14. ---
  15. apiVersion: k8s.cni.cncf.io/v1
  16. kind: NetworkAttachmentDefinition
  17. metadata:
  18. name: {{ $objectData.name }}
  19. {{- $labels := (include "ix.v1.common.lib.metadata.allLabels" $rootCtx | fromYaml) | default dict -}}
  20. {{- with (include "ix.v1.common.lib.metadata.render" (dict "rootCtx" $rootCtx "labels" $labels) | trim) }}
  21. labels:
  22. {{- . | nindent 4 }}
  23. {{- end -}}
  24. {{- $annotations := (include "ix.v1.common.lib.metadata.allAnnotations" $rootCtx | fromYaml) | default dict -}}
  25. {{- with (include "ix.v1.common.lib.metadata.render" (dict "rootCtx" $rootCtx "annotations" $annotations) | trim) }}
  26. annotations:
  27. {{- . | nindent 4 }}
  28. {{- end }}
  29. spec:
  30. config: {{ $objectData.config | squote }}
  31. {{- end -}}