argocd-helm/charts/argo-events/templates/_helpers.tpl
Petr Drastil d2c2055290
feat(argo-events): Upgrade argo-events to v1.7.0 (#1269)
* feat(argo-events) : Upgrade argo-events to v1.7.0

Signed-off-by: Petr Drastil <petr.drastil@gmail.com>

* Fix typos

Signed-off-by: Petr Drastil <petr.drastil@gmail.com>

* Add missing braces

Signed-off-by: Petr Drastil <petr.drastil@gmail.com>

* Use templates for service account names

Signed-off-by: Petr Drastil <petr.drastil@gmail.com>

* Drop application labels

Signed-off-by: Petr Drastil <petr.drastil@gmail.com>

* Update documentation

Signed-off-by: Petr Drastil <petr.drastil@gmail.com>

* Move CRDs to template folder

Signed-off-by: Petr Drastil <petr.drastil@gmail.com>

* Disable webhook by default

Signed-off-by: Petr Drastil <petr.drastil@gmail.com>

* Fix indentation

Signed-off-by: Petr Drastil <petr.drastil@gmail.com>

* Update README

Signed-off-by: Petr Drastil <petr.drastil@gmail.com>

* Drop prefix from aggregate-roles

Signed-off-by: Petr Drastil <petr.drastil@gmail.com>

* Fix typo aggragate-roles.yaml -> aggregate-roles.yaml

Signed-off-by: Marco Kilchhofer <mkilchhofer@users.noreply.github.com>

* Use helm-docs.sh

Signed-off-by: Marco Kilchhofer <mkilchhofer@users.noreply.github.com>

* Fix typo REALEASE -> RELEASE

Signed-off-by: Marco Kilchhofer <mkilchhofer@users.noreply.github.com>

* Use consistent wording/style

Signed-off-by: Marco Kilchhofer <mkilchhofer@users.noreply.github.com>

Co-authored-by: Marco Kilchhofer <mkilchhofer@users.noreply.github.com>
2022-06-14 17:37:47 +02:00

99 lines
3 KiB
Smarty

{{/* vim: set filetype=mustache: */}}
{{/*
Expand the name of the chart.
*/}}
{{- define "argo-events.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-events.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 controller name and version as used by the chart label.
*/}}
{{- define "argo-events.controller.fullname" -}}
{{- printf "%s-%s" (include "argo-events.fullname" .) .Values.controller.name | trunc 63 | trimSuffix "-" -}}
{{- end -}}
{{/*
Create the name of the controller service account to use
*/}}
{{- define "argo-events.controller.serviceAccountName" -}}
{{- if .Values.controller.serviceAccount.create -}}
{{ default (include "argo-events.controller.fullname" .) .Values.controller.serviceAccount.name }}
{{- else -}}
{{ default "default" .Values.controller.serviceAccount.name }}
{{- end -}}
{{- end -}}
{{/*
Create webhook name and version as used by the chart label.
*/}}
{{- define "argo-events.webhook.fullname" }}
{{- printf "%s-%s" (include "argo-events.fullname" .) .Values.webhook.name | trunc 63 | trimSuffix "-" -}}
{{- end -}}
{{/*
Create the name of the webhook service account to use
*/}}
{{- define "argo-events.webhook.serviceAccountName" -}}
{{- if .Values.webhook.serviceAccount.create -}}
{{ default (include "argo-events.webhook.fullname" .) .Values.webhook.serviceAccount.name }}
{{- else -}}
{{ default "default" .Values.webhook.serviceAccount.name }}
{{- end -}}
{{- end -}}
{{/*
Create chart name and version as used by the chart label.
*/}}
{{- define "argo-events.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}}
{{- end -}}
{{/*
Common labels
*/}}
{{- define "argo-events.labels" -}}
helm.sh/chart: {{ include "argo-events.chart" .context }}
{{ include "argo-events.selectorLabels" (dict "context" .context "component" .component "name" .name) }}
app.kubernetes.io/managed-by: {{ .context.Release.Service }}
app.kubernetes.io/part-of: argo-events
{{- end }}
{{/*
Selector labels
*/}}
{{- define "argo-events.selectorLabels" -}}
{{- if .name -}}
app.kubernetes.io/name: {{ include "argo-events.name" .context }}-{{ .name }}
{{- end }}
app.kubernetes.io/instance: {{ .context.Release.Name }}
{{- if .component }}
app.kubernetes.io/component: {{ .component }}
{{- end }}
{{- end }}
{{/*
Return the default Argo Events app version
*/}}
{{- define "argo-events.defaultTag" -}}
{{- default .Chart.AppVersion .Values.global.image.tag }}
{{- end -}}