argocd-helm/charts/argo-cd/templates/_helpers.tpl
Carlos Juan Gómez Peñalver d7da8e863f
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 f4b81cbb6f.

* 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 12:31:13 -04:00

118 lines
No EOL
3.8 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 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" -}}
{{ $redisHa := (index .Values "redis-ha") }}
{{- if $redisHa.enabled -}}
{{- if $redisHa.haproxy.enabled -}}
{{- printf "%s-redis-ha-haproxy" .Release.Name | trunc 63 | trimSuffix "-" -}}
{{- end -}}
{{- else -}}
{{- printf "%s-%s" (include "argo-cd.fullname" .) .Values.redis.name | trunc 63 | trimSuffix "-" -}}
{{- end -}}
{{- end -}}
{{/*
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 "-" -}}
{{- end -}}