2021-05-21 12:19:05 +00:00
|
|
|
{{/* vim: set filetype=mustache: */}}
|
|
|
|
|
|
|
|
{{/*
|
|
|
|
Create argo workflows server name and version as used by the chart label.
|
|
|
|
*/}}
|
|
|
|
{{- define "argo-workflows.server.fullname" -}}
|
|
|
|
{{- printf "%s-%s" (include "argo-workflows.fullname" .) .Values.server.name | trunc 63 | trimSuffix "-" -}}
|
|
|
|
{{- end -}}
|
|
|
|
|
|
|
|
{{/*
|
|
|
|
Create controller name and version as used by the chart label.
|
|
|
|
*/}}
|
|
|
|
{{- define "argo-workflows.controller.fullname" -}}
|
|
|
|
{{- printf "%s-%s" (include "argo-workflows.fullname" .) .Values.controller.name | trunc 63 | trimSuffix "-" -}}
|
|
|
|
{{- end -}}
|
|
|
|
|
|
|
|
{{/*
|
|
|
|
Expand the name of the chart.
|
|
|
|
*/}}
|
|
|
|
{{- define "argo-workflows.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).
|
|
|
|
*/}}
|
|
|
|
{{- define "argo-workflows.fullname" -}}
|
2021-05-31 16:18:09 +00:00
|
|
|
{{- if .Values.fullnameOverride -}}
|
|
|
|
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}}
|
|
|
|
{{- else -}}
|
2021-05-21 12:19:05 +00:00
|
|
|
{{- $name := default .Chart.Name .Values.nameOverride -}}
|
2021-05-31 16:18:09 +00:00
|
|
|
{{- if contains $name .Release.Name -}}
|
|
|
|
{{- .Release.Name | trunc 63 | trimSuffix "-" -}}
|
|
|
|
{{- else -}}
|
2021-05-21 12:19:05 +00:00
|
|
|
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}}
|
|
|
|
{{- end -}}
|
2021-05-31 16:18:09 +00:00
|
|
|
{{- end -}}
|
|
|
|
{{- end -}}
|
2021-05-21 12:19:05 +00:00
|
|
|
|
|
|
|
{{/*
|
|
|
|
Create chart name and version as used by the chart label.
|
|
|
|
*/}}
|
|
|
|
{{- define "argo-workflows.chart" -}}
|
|
|
|
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}}
|
|
|
|
{{- end -}}
|
|
|
|
|
|
|
|
{{/*
|
|
|
|
Common labels
|
|
|
|
*/}}
|
|
|
|
{{- define "argo-workflows.labels" -}}
|
|
|
|
helm.sh/chart: {{ include "argo-workflows.chart" .context }}
|
|
|
|
{{ include "argo-workflows.selectorLabels" (dict "context" .context "component" .component "name" .name) }}
|
|
|
|
app.kubernetes.io/managed-by: {{ .context.Release.Service }}
|
|
|
|
app.kubernetes.io/part-of: argo-workflows
|
|
|
|
{{- end }}
|
|
|
|
|
|
|
|
{{/*
|
|
|
|
Selector labels
|
|
|
|
*/}}
|
|
|
|
{{- define "argo-workflows.selectorLabels" -}}
|
|
|
|
{{- if .name -}}
|
|
|
|
app.kubernetes.io/name: {{ include "argo-workflows.name" .context }}-{{ .name }}
|
|
|
|
{{ end -}}
|
|
|
|
app.kubernetes.io/instance: {{ .context.Release.Name }}
|
|
|
|
{{- if .component }}
|
|
|
|
app.kubernetes.io/component: {{ .component }}
|
|
|
|
{{- end }}
|
|
|
|
{{- end }}
|
|
|
|
|
|
|
|
{{/*
|
|
|
|
Create the name of the server service account to use
|
|
|
|
*/}}
|
|
|
|
{{- define "argo-workflows.serverServiceAccountName" -}}
|
|
|
|
{{- if .Values.server.serviceAccount.create -}}
|
2021-05-27 16:33:22 +00:00
|
|
|
{{ default (include "argo-workflows.server.fullname" .) .Values.server.serviceAccount.name }}
|
2021-05-21 12:19:05 +00:00
|
|
|
{{- else -}}
|
|
|
|
{{ default "default" .Values.server.serviceAccount.name }}
|
|
|
|
{{- end -}}
|
|
|
|
{{- end -}}
|
|
|
|
|
|
|
|
{{/*
|
|
|
|
Create the name of the controller service account to use
|
|
|
|
*/}}
|
|
|
|
{{- define "argo-workflows.controllerServiceAccountName" -}}
|
|
|
|
{{- if .Values.controller.serviceAccount.create -}}
|
2021-05-27 16:33:22 +00:00
|
|
|
{{ default (include "argo-workflows.controller.fullname" .) .Values.controller.serviceAccount.name }}
|
2021-05-21 12:19:05 +00:00
|
|
|
{{- else -}}
|
|
|
|
{{ default "default" .Values.controller.serviceAccount.name }}
|
|
|
|
{{- end -}}
|
|
|
|
{{- end -}}
|
|
|
|
|
|
|
|
{{/*
|
|
|
|
Return the appropriate apiVersion for ingress
|
|
|
|
*/}}
|
|
|
|
{{- define "argo-workflows.ingress.apiVersion" -}}
|
2021-06-08 13:14:55 +00:00
|
|
|
{{- if semverCompare "<1.14-0" (include "argo-workflows.kubeVersion" $) -}}
|
2021-05-21 12:19:05 +00:00
|
|
|
{{- print "extensions/v1beta1" -}}
|
2021-06-08 13:14:55 +00:00
|
|
|
{{- else if semverCompare "<1.19-0" (include "argo-workflows.kubeVersion" $) -}}
|
2021-05-21 12:19:05 +00:00
|
|
|
{{- print "networking.k8s.io/v1beta1" -}}
|
|
|
|
{{- else -}}
|
|
|
|
{{- print "networking.k8s.io/v1" -}}
|
|
|
|
{{- end -}}
|
|
|
|
{{- end -}}
|
2021-06-08 13:14:55 +00:00
|
|
|
|
2022-05-22 07:43:12 +00:00
|
|
|
{{/*
|
|
|
|
Return the appropriate apiVersion for pod disruption budget
|
|
|
|
*/}}
|
|
|
|
{{- define "argo-workflows.podDisruptionBudget.apiVersion" -}}
|
|
|
|
{{- if semverCompare "<1.21-0" (include "argo-workflows.kubeVersion" $) -}}
|
|
|
|
{{- print "policy/v1beta1" -}}
|
|
|
|
{{- else -}}
|
|
|
|
{{- print "policy/v1" -}}
|
|
|
|
{{- end -}}
|
|
|
|
{{- end -}}
|
|
|
|
|
2021-06-08 13:14:55 +00:00
|
|
|
{{/*
|
|
|
|
Return the target Kubernetes version
|
|
|
|
*/}}
|
|
|
|
{{- define "argo-workflows.kubeVersion" -}}
|
|
|
|
{{- default .Capabilities.KubeVersion.Version .Values.kubeVersionOverride }}
|
|
|
|
{{- end -}}
|
2022-07-27 00:50:42 +00:00
|
|
|
|
|
|
|
{{/*
|
|
|
|
Return the default Argo Workflows app version
|
|
|
|
*/}}
|
|
|
|
{{- define "argo-workflows.defaultTag" -}}
|
|
|
|
{{- default .Chart.AppVersion .Values.images.tag }}
|
|
|
|
{{- end -}}
|