feat: Add ability to override api versions for argocd

Signed-off-by: Atze de Vries <devries@zorgdomein.nl>
This commit is contained in:
Atze de Vries 2021-05-26 14:45:17 +02:00
parent f6069848f5
commit 5c7e4c32d4
4 changed files with 17 additions and 3 deletions

View file

@ -2,7 +2,7 @@ apiVersion: v2
appVersion: 2.0.1
description: A Helm chart for ArgoCD, a declarative, GitOps continuous delivery tool for Kubernetes.
name: argo-cd
version: 3.6.2
version: 3.6.3
home: https://github.com/argoproj/argo-helm
icon: https://raw.githubusercontent.com/argoproj/argo/master/docs/assets/argo.png
keywords:

View file

@ -144,7 +144,9 @@ app.kubernetes.io/component: {{ .component }}
Return the appropriate apiVersion for ingress
*/}}
{{- define "argo-cd.ingress.apiVersion" -}}
{{- if semverCompare "<1.14-0" (include "argo-cd.kubeVersion" $) -}}
{{- if .Values.APIOverrides -}}
{{- print .Values.APIOverrides.ingress -}}
{{- else if semverCompare "<1.14-0" (include "argo-cd.kubeVersion" $) -}}
{{- print "extensions/v1beta1" -}}
{{- else if semverCompare "<1.19-0" (include "argo-cd.kubeVersion" $) -}}
{{- print "networking.k8s.io/v1beta1" -}}

View file

@ -1,5 +1,7 @@
{{- if .Values.server.certificate.enabled -}}
{{- if .Capabilities.APIVersions.Has "cert-manager.io/v1" }}
{{- if .Values.APIOverrides -}}
apiVersion: {{ .Values.APIOverrides.certmanager }}
{{- else if .Capabilities.APIVersions.Has "cert-manager.io/v1" }}
apiVersion: cert-manager.io/v1
{{- else if .Capabilities.APIVersions.Has "cert-manager.io/v1alpha3" }}
apiVersion: cert-manager.io/v1alpha3

View file

@ -23,6 +23,16 @@ global:
# hostnames:
# - git.myhostname
# Override APIVersions
# If you want to template helm charts but cannot access k8s API server
# you can set api versions here
APIOverrides:
enabled: false
certmanager: cert-manager.io/v1
ingress: networking.k8s.io/v1beta1
## Controller
controller:
name: application-controller