_grpc.tpl 747 B

1234567891011121314151617181920212223
  1. {{/* Returns grpc action */}}
  2. {{/* Call this template:
  3. {{ include "ix.v1.common.lib.container.actions.tcpSocket" (dict "rootCtx" $ "objectData" $objectData "caller" $caller) }}
  4. rootCtx: The root context of the chart.
  5. objectData: The object data to be used to render the container.
  6. */}}
  7. {{- define "ix.v1.common.lib.container.actions.grpc" -}}
  8. {{- $rootCtx := .rootCtx -}}
  9. {{- $objectData := .objectData -}}
  10. {{- $caller := .caller -}}
  11. {{- if not $objectData.port -}}
  12. {{- fail (printf "Container - Expected non-empty <%s> <port> on [grpc] type" $caller) -}}
  13. {{- end -}}
  14. {{- $port := $objectData.port -}}
  15. {{- if kindIs "string" $port -}}
  16. {{- $port = tpl $port $rootCtx -}}
  17. {{- end }}
  18. grpc:
  19. port: {{ $port }}
  20. {{- end -}}