66 lines
1.9 KiB
Smarty
66 lines
1.9 KiB
Smarty
{{/* vim: set filetype=mustache: */}}
|
|
{{/*
|
|
Expand the name of the chart.
|
|
*/}}
|
|
{{- define "argo-cd.name" -}}
|
|
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}}
|
|
{{- end -}}
|
|
|
|
{{/*
|
|
Create a default fully qualified app name.
|
|
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
|
|
If release name contains chart name it will be used as a full name.
|
|
*/}}
|
|
{{- define "argo-cd.fullname" -}}
|
|
{{- if .Values.fullnameOverride -}}
|
|
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}}
|
|
{{- else -}}
|
|
{{- $name := default .Chart.Name .Values.nameOverride -}}
|
|
{{- if contains $name .Release.Name -}}
|
|
{{- .Release.Name | trunc 63 | trimSuffix "-" -}}
|
|
{{- else -}}
|
|
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}}
|
|
{{- end -}}
|
|
{{- end -}}
|
|
{{- end -}}
|
|
|
|
{{/*
|
|
Create chart name and version as used by the chart label.
|
|
*/}}
|
|
{{- define "argo-cd.chart" -}}
|
|
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}}
|
|
{{- end -}}
|
|
|
|
{{/*
|
|
Create Argo CD app version
|
|
*/}}
|
|
{{- define "argo-cd.defaultTag" -}}
|
|
{{- default .Chart.AppVersion .Values.global.image.tag }}
|
|
{{- end -}}
|
|
|
|
{{/*
|
|
Common labels
|
|
*/}}
|
|
{{- define "argo-cd.labels" -}}
|
|
helm.sh/chart: {{ include "argo-cd.chart" .context }}
|
|
{{ include "argo-cd.selectorLabels" (dict "context" .context "component" .component "name" .name) }}
|
|
app.kubernetes.io/managed-by: {{ .context.Release.Service }}
|
|
app.kubernetes.io/part-of: argocd
|
|
{{- with .context.Values.global.additionalLabels }}
|
|
{{ toYaml . }}
|
|
{{- end }}
|
|
{{- end }}
|
|
|
|
{{/*
|
|
Selector labels
|
|
*/}}
|
|
{{- define "argo-cd.selectorLabels" -}}
|
|
{{- if .name -}}
|
|
app.kubernetes.io/name: {{ include "argo-cd.name" .context }}-{{ .name }}
|
|
{{ end -}}
|
|
app.kubernetes.io/instance: {{ .context.Release.Name }}
|
|
{{- if .component }}
|
|
app.kubernetes.io/component: {{ .component }}
|
|
{{- end }}
|
|
{{- end }}
|