|
| 1 | +{{/* |
| 2 | +Expand the name of the chart. |
| 3 | +*/}} |
| 4 | +{{- define "mcp-lifecycle-operator.name" -}} |
| 5 | +{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }} |
| 6 | +{{- end }} |
| 7 | + |
| 8 | +{{/* |
| 9 | +Create a default fully qualified app name. |
| 10 | +*/}} |
| 11 | +{{- define "mcp-lifecycle-operator.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 | +Create chart name and version as used by the chart label. |
| 26 | +*/}} |
| 27 | +{{- define "mcp-lifecycle-operator.chart" -}} |
| 28 | +{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} |
| 29 | +{{- end }} |
| 30 | + |
| 31 | +{{/* |
| 32 | +Common labels |
| 33 | +*/}} |
| 34 | +{{- define "mcp-lifecycle-operator.labels" -}} |
| 35 | +helm.sh/chart: {{ include "mcp-lifecycle-operator.chart" . }} |
| 36 | +{{ include "mcp-lifecycle-operator.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 "mcp-lifecycle-operator.selectorLabels" -}} |
| 47 | +app.kubernetes.io/name: {{ include "mcp-lifecycle-operator.name" . }} |
| 48 | +app.kubernetes.io/instance: {{ .Release.Name }} |
| 49 | +control-plane: controller-manager |
| 50 | +{{- end }} |
| 51 | + |
| 52 | +{{/* |
| 53 | +Create the name of the service account to use. |
| 54 | +*/}} |
| 55 | +{{- define "mcp-lifecycle-operator.serviceAccountName" -}} |
| 56 | +{{- if .Values.serviceAccount.create }} |
| 57 | +{{- default (printf "%s-controller-manager" (include "mcp-lifecycle-operator.fullname" .)) .Values.serviceAccount.name }} |
| 58 | +{{- else }} |
| 59 | +{{- default "default" .Values.serviceAccount.name }} |
| 60 | +{{- end }} |
| 61 | +{{- end }} |
| 62 | + |
| 63 | +{{/* |
| 64 | +Controller manager image |
| 65 | +*/}} |
| 66 | +{{- define "mcp-lifecycle-operator.image" -}} |
| 67 | +{{- printf "%s:%s" .Values.image.repository (.Values.image.tag | default .Chart.AppVersion) }} |
| 68 | +{{- end }} |
0 commit comments