fix(argo-cd): Add option to override kubeVersion (#704)

* feat: Add global kubeCapabilities

Signed-off-by: Oliver Bähler <oliverbaehler@hotmail.com>

* chore: change var global.kubeCapabilities > kubeVersionOverride

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

* docs: add missing variable in README

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

* fix: Bump version in README again

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

Co-authored-by: Marco Kilchhofer <mkilchhofer@users.noreply.github.com>
This commit is contained in:
Oliver Bähler 2021-05-23 14:25:26 +02:00 committed by GitHub
parent 9af9403ed4
commit eb659b10c3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 28 additions and 3 deletions

View file

@ -144,15 +144,22 @@ app.kubernetes.io/component: {{ .component }}
Return the appropriate apiVersion for ingress
*/}}
{{- define "argo-cd.ingress.apiVersion" -}}
{{- if semverCompare "<1.14-0" .Capabilities.KubeVersion.GitVersion -}}
{{- if semverCompare "<1.14-0" (include "argo-cd.kubeVersion" $) -}}
{{- print "extensions/v1beta1" -}}
{{- else if semverCompare "<1.19-0" .Capabilities.KubeVersion.GitVersion -}}
{{- else if semverCompare "<1.19-0" (include "argo-cd.kubeVersion" $) -}}
{{- print "networking.k8s.io/v1beta1" -}}
{{- else -}}
{{- print "networking.k8s.io/v1" -}}
{{- end -}}
{{- end -}}
{{/*
Return the target Kubernetes version
*/}}
{{- define "argo-cd.kubeVersion" -}}
{{- default .Capabilities.KubeVersion.Version .Values.kubeVersionOverride }}
{{- end -}}
{{/*
Argo Configuration Preset Values (Incluenced by Values configuration)
*/}}