File tree Expand file tree Collapse file tree 1 file changed +9
-5
lines changed
Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Original file line number Diff line number Diff line change 22{{- $fullName := include "codetogether.fullname" . -}}
33{{- $svcPort := .Values.service.port -}}
44{{- $host := (urlParse .Values.codetogether.url).host }}
5- {{- if semverCompare ">=1.19" .Capabilities.KubeVersion.GitVersion -}}
5+ {{- /* Prefer API discovery; fall back to version check. */ -}}
6+ {{- $kver := .Capabilities.KubeVersion.Version | default .Capabilities.KubeVersion.GitVersion -}}
7+ {{- $hasIngressV1 := .Capabilities.APIVersions.Has "networking.k8s.io/v1/Ingress" -}}
8+ {{- $isIngressV1 := or $hasIngressV1 (semverCompare ">=1.19-0" $kver) -}}
9+ {{- if $isIngressV1 -}}
610apiVersion : networking.k8s.io/v1
711{{- else -}}
812apiVersion : networking.k8s.io/v1beta1
@@ -17,7 +21,7 @@ metadata:
1721 {{- toYaml . | nindent 4 }}
1822 {{- end }}
1923spec :
20- {{- if and .Values.ingress.className (semverCompare ">=1.18" .Capabilities.KubeVersion.GitVersion) }}
24+ {{- if and .Values.ingress.className $isIngressV1 }}
2125 ingressClassName : {{ .Values.ingress.className }}
2226 {{- end}}
2327 {{- if .Values.ingress.tls }}
@@ -31,11 +35,11 @@ spec:
3135 http :
3236 paths :
3337 - path : /
34- {{- if (semverCompare ">=1.18" $.Capabilities.KubeVersion.GitVersion) }}
38+ {{- if $isIngressV1 }}
3539 pathType : " Prefix"
3640 {{- end }}
3741 backend :
38- {{- if semverCompare ">=1.19" $.Capabilities.KubeVersion.GitVersion }}
42+ {{- if $isIngressV1 }}
3943 service :
4044 name : {{ $fullName }}
4145 port :
4448 serviceName : {{ $fullName }}
4549 servicePort : {{ $svcPort }}
4650 {{- end }}
47- {{- end }}
51+ {{- end }}
You can’t perform that action at this time.
0 commit comments