_portal.tpl 628 B

123456789101112131415161718192021
  1. {{- define "gitea.portal" -}}
  2. ---
  3. apiVersion: v1
  4. kind: ConfigMap
  5. metadata:
  6. name: portal
  7. data:
  8. path: /
  9. port: {{ .Values.giteaNetwork.webPort | quote }}
  10. {{ if or (hasPrefix "https://" .Values.giteaNetwork.rootURL) .Values.giteaNetwork.certificateID }}
  11. protocol: https
  12. {{ else }}
  13. protocol: http
  14. {{ end }}
  15. {{- $host := "$node_ip" -}}
  16. {{ with .Values.giteaNetwork.rootURL }} {{/* Trim protocol and trailing slash */}}
  17. {{ $host = (. | trimPrefix "https://" | trimPrefix "http://" | trimSuffix "/") }}
  18. {{ $host = mustRegexReplaceAll "(.*):[0-9]+" $host "${1}" }}
  19. {{ end }}
  20. host: {{ $host }}
  21. {{- end -}}