argocd-helm/charts/argo-cd/templates/_helpers.tpl

118 lines
3.8 KiB
Smarty
Raw Normal View History

{{/* 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 -}}
2019-11-05 00:17:25 +00:00
{{/*
Create controller name and version as used by the chart label.
*/}}
{{- define "argo-cd.controller.fullname" -}}
{{- printf "%s-%s" (include "argo-cd.fullname" .) .Values.controller.name | trunc 63 | trimSuffix "-" -}}
{{- end -}}
{{/*
Create dex name and version as used by the chart label.
*/}}
{{- define "argo-cd.dex.fullname" -}}
{{- printf "%s-%s" (include "argo-cd.fullname" .) .Values.dex.name | trunc 63 | trimSuffix "-" -}}
{{- end -}}
{{/*
Create redis name and version as used by the chart label.
*/}}
{{- define "argo-cd.redis.fullname" -}}
feat: argo-cd can deploy Redis HA (#270) * feat: argo-cd can deploy Redis HA Signed-off-by: Carlos Juan Gómez Peñalver <carlosjuangp@gmail.com> * fix: add unarchived subchart redis-ha Signed-off-by: Carlos Juan Gómez Peñalver <carlosjuangp@gmail.com> * fix: Redis HA upgraded since 4.3.4 contains a bug on the chart Signed-off-by: Carlos Juan Gómez Peñalver <carlosjuangp@gmail.com> * docs: how to configure Redis and Redis HA * fix: add missing chart folder Signed-off-by: Carlos Juan Gómez Peñalver <carlosjuangp@gmail.com> * fix: Helm bug with subcharts and alias * fix: Chart version * fix: Remove archived subcharts Signed-off-by: Carlos Juan Gómez Peñalver <carlosjuangp@gmail.com> * fix: lint script Signed-off-by: Carlos Juan Gómez Peñalver <carlosjuangp@gmail.com> * Revert "fix: lint script" This reverts commit f4b81cbb6fc6d6c271f07b3d271a110b43edb9dd. * fix: lint and publish scripts Signed-off-by: Carlos Juan Gómez Peñalver <carlosjuangp@gmail.com> * fix: align test-image versions Signed-off-by: Carlos Juan Gómez Peñalver <carlosjuangp@gmail.com> * fix: remove sudo from scripts Signed-off-by: Carlos Juan Gómez Peñalver <carlosjuangp@gmail.com> * fix: add required repositories to helm Signed-off-by: Carlos Juan Gómez Peñalver <carlosjuangp@gmail.com> * fix: simplify expression Signed-off-by: Carlos Juan Gómez Peñalver <carlosjuangp@gmail.com> * fix: bump up chart version Signed-off-by: Carlos Juan Gómez Peñalver <carlosjuangp@gmail.com> Co-authored-by: Spencer Gilbert <Spencer.Gilbert@gmail.com>
2020-04-09 16:31:13 +00:00
{{ $redisHa := (index .Values "redis-ha") }}
{{- if $redisHa.enabled -}}
{{- if $redisHa.haproxy.enabled -}}
{{- printf "%s-redis-ha-haproxy" .Release.Name | trunc 63 | trimSuffix "-" -}}
{{- end -}}
{{- else -}}
2019-11-05 00:17:25 +00:00
{{- printf "%s-%s" (include "argo-cd.fullname" .) .Values.redis.name | trunc 63 | trimSuffix "-" -}}
{{- end -}}
feat: argo-cd can deploy Redis HA (#270) * feat: argo-cd can deploy Redis HA Signed-off-by: Carlos Juan Gómez Peñalver <carlosjuangp@gmail.com> * fix: add unarchived subchart redis-ha Signed-off-by: Carlos Juan Gómez Peñalver <carlosjuangp@gmail.com> * fix: Redis HA upgraded since 4.3.4 contains a bug on the chart Signed-off-by: Carlos Juan Gómez Peñalver <carlosjuangp@gmail.com> * docs: how to configure Redis and Redis HA * fix: add missing chart folder Signed-off-by: Carlos Juan Gómez Peñalver <carlosjuangp@gmail.com> * fix: Helm bug with subcharts and alias * fix: Chart version * fix: Remove archived subcharts Signed-off-by: Carlos Juan Gómez Peñalver <carlosjuangp@gmail.com> * fix: lint script Signed-off-by: Carlos Juan Gómez Peñalver <carlosjuangp@gmail.com> * Revert "fix: lint script" This reverts commit f4b81cbb6fc6d6c271f07b3d271a110b43edb9dd. * fix: lint and publish scripts Signed-off-by: Carlos Juan Gómez Peñalver <carlosjuangp@gmail.com> * fix: align test-image versions Signed-off-by: Carlos Juan Gómez Peñalver <carlosjuangp@gmail.com> * fix: remove sudo from scripts Signed-off-by: Carlos Juan Gómez Peñalver <carlosjuangp@gmail.com> * fix: add required repositories to helm Signed-off-by: Carlos Juan Gómez Peñalver <carlosjuangp@gmail.com> * fix: simplify expression Signed-off-by: Carlos Juan Gómez Peñalver <carlosjuangp@gmail.com> * fix: bump up chart version Signed-off-by: Carlos Juan Gómez Peñalver <carlosjuangp@gmail.com> Co-authored-by: Spencer Gilbert <Spencer.Gilbert@gmail.com>
2020-04-09 16:31:13 +00:00
{{- end -}}
2019-11-05 00:17:25 +00:00
{{/*
Create argocd server name and version as used by the chart label.
*/}}
{{- define "argo-cd.server.fullname" -}}
{{- printf "%s-%s" (include "argo-cd.fullname" .) .Values.server.name | trunc 63 | trimSuffix "-" -}}
{{- end -}}
{{/*
Create argocd repo-server name and version as used by the chart label.
*/}}
{{- define "argo-cd.repoServer.fullname" -}}
{{- printf "%s-%s" (include "argo-cd.fullname" .) .Values.repoServer.name | trunc 63 | trimSuffix "-" -}}
{{- end -}}
{{/*
Create the name of the controller service account to use
*/}}
{{- define "argo-cd.controllerServiceAccountName" -}}
{{- if .Values.controller.serviceAccount.create -}}
{{ default (include "argo-cd.fullname" .) .Values.controller.serviceAccount.name }}
{{- else -}}
{{ default "default" .Values.controller.serviceAccount.name }}
{{- end -}}
{{- end -}}
{{/*
Create the name of the dex service account to use
*/}}
{{- define "argo-cd.dexServiceAccountName" -}}
{{- if .Values.dex.serviceAccount.create -}}
{{ default (include "argo-cd.fullname" .) .Values.dex.serviceAccount.name }}
{{- else -}}
{{ default "default" .Values.dex.serviceAccount.name }}
{{- end -}}
{{- end -}}
{{/*
Create the name of the ArgoCD server service account to use
*/}}
{{- define "argo-cd.serverServiceAccountName" -}}
{{- if .Values.server.serviceAccount.create -}}
{{ default (include "argo-cd.fullname" .) .Values.server.serviceAccount.name }}
{{- else -}}
{{ default "default" .Values.server.serviceAccount.name }}
{{- end -}}
{{- end -}}
{{/*
Create the name of the repo-server service account to use
*/}}
{{- define "argo-cd.repoServerServiceAccountName" -}}
{{- if .Values.repoServer.serviceAccount.create -}}
{{ default (include "argo-cd.fullname" .) .Values.repoServer.serviceAccount.name }}
{{- else -}}
{{ default "default" .Values.repoServer.serviceAccount.name }}
{{- 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 "-" -}}
2019-11-05 00:17:25 +00:00
{{- end -}}