|
| 1 | +{{/* |
| 2 | +Expand the name of the chart. |
| 3 | +*/}} |
| 4 | +{{- define "static-webhost.name" -}} |
| 5 | +{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }} |
| 6 | +{{- end }} |
| 7 | + |
| 8 | +{{/* |
| 9 | +Fully qualified app name. |
| 10 | +*/}} |
| 11 | +{{- define "static-webhost.fullname" -}} |
| 12 | +{{- if .Values.fullnameOverride }} |
| 13 | +{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }} |
| 14 | +{{- else }} |
| 15 | +{{- $name := default .Chart.Name .Values.nameOverride }} |
| 16 | +{{- if contains $name .Release.Name }} |
| 17 | +{{- .Release.Name | trunc 63 | trimSuffix "-" }} |
| 18 | +{{- else }} |
| 19 | +{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }} |
| 20 | +{{- end }} |
| 21 | +{{- end }} |
| 22 | +{{- end }} |
| 23 | + |
| 24 | +{{/* |
| 25 | +Chart label. |
| 26 | +*/}} |
| 27 | +{{- define "static-webhost.chart" -}} |
| 28 | +{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} |
| 29 | +{{- end }} |
| 30 | + |
| 31 | +{{/* |
| 32 | +Common labels |
| 33 | +*/}} |
| 34 | +{{- define "static-webhost.labels" -}} |
| 35 | +helm.sh/chart: {{ include "static-webhost.chart" . }} |
| 36 | +{{ include "static-webhost.selectorLabels" . }} |
| 37 | +{{- if .Chart.AppVersion }} |
| 38 | +app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} |
| 39 | +{{- end }} |
| 40 | +app.kubernetes.io/managed-by: {{ .Release.Service }} |
| 41 | +{{- end }} |
| 42 | + |
| 43 | +{{/* |
| 44 | +Selector labels |
| 45 | +*/}} |
| 46 | +{{- define "static-webhost.selectorLabels" -}} |
| 47 | +app.kubernetes.io/name: {{ include "static-webhost.name" . }} |
| 48 | +app.kubernetes.io/instance: {{ .Release.Name }} |
| 49 | +{{- end }} |
| 50 | + |
| 51 | +{{/* |
| 52 | +Component-scoped selector labels (used by per-component Deployments/Services). |
| 53 | +Call with: (dict "Context" . "Component" "code-server") |
| 54 | +*/}} |
| 55 | +{{- define "static-webhost.componentSelectorLabels" -}} |
| 56 | +{{ include "static-webhost.selectorLabels" .Context }} |
| 57 | +app.kubernetes.io/component: {{ .Component }} |
| 58 | +{{- end }} |
0 commit comments