Files
chart/library/ix-dev/community/tailscale/templates/_helper.tpl
Stavros Kois 4f4acbc7c7 NAS-121476 / 23.10 / Add tailscale to community train (#1122)
* Add tailscale to community catalog

* mock key format
2023-04-20 01:33:53 +03:00

33 lines
940 B
Smarty

{{- define "tailscale.args" -}}
{{- $args := list -}}
{{- with .Values.tailscaleConfig.hostname -}}
{{- $args = mustAppend $args (printf "--hostname %v" .) -}}
{{- end -}}
{{- with .Values.tailscaleConfig.advertiseExitNode -}}
{{- $args = mustAppend $args "--advertise-exit-node" -}}
{{- end -}}
{{- with .Values.tailscaleConfig.extraArgs -}}
{{- $args = mustAppend $args . -}}
{{- end -}}
{{- if $args -}}
{{- $args | join " " -}}
{{- end -}}
{{- end -}}
{{- define "tailscale.validation" -}}
{{- if not .Values.tailscaleConfig.authkey -}}
{{- fail "Tailscale - Expected non-empty [Auth Key]" -}}
{{- end -}}
{{- with .Values.tailscaleConfig.hostname -}}
{{- if not (mustRegexMatch "^[a-z0-9-]+$" .) -}}
{{- fail "Tailscale - Expected [Hostname] to match the following - [All lowercase, numbers, dashes, No spaces, No underscores]" -}}
{{- end -}}
{{- end -}}
{{- end -}}