From 7ade1d8393bd28ffe3506b62a4fd525b810dea6a Mon Sep 17 00:00:00 2001 From: danc094codetogether Date: Fri, 23 Jan 2026 13:59:08 -0600 Subject: [PATCH] fix(intel-chart): ensure Ingress v1 + pathType for modern Kubernetes Fixes: #196 --- charts/intel/templates/ingress.yaml | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/charts/intel/templates/ingress.yaml b/charts/intel/templates/ingress.yaml index e3dd22c..38881c0 100644 --- a/charts/intel/templates/ingress.yaml +++ b/charts/intel/templates/ingress.yaml @@ -2,7 +2,11 @@ {{- $fullName := include "codetogether.fullname" . -}} {{- $svcPort := .Values.service.port -}} {{- $host := (urlParse .Values.codetogether.url).host }} -{{- if semverCompare ">=1.19" .Capabilities.KubeVersion.GitVersion -}} +{{- /* Prefer API discovery; fall back to version check. */ -}} +{{- $kver := .Capabilities.KubeVersion.Version | default .Capabilities.KubeVersion.GitVersion -}} +{{- $hasIngressV1 := .Capabilities.APIVersions.Has "networking.k8s.io/v1/Ingress" -}} +{{- $isIngressV1 := or $hasIngressV1 (semverCompare ">=1.19-0" $kver) -}} +{{- if $isIngressV1 -}} apiVersion: networking.k8s.io/v1 {{- else -}} apiVersion: networking.k8s.io/v1beta1 @@ -17,7 +21,7 @@ metadata: {{- toYaml . | nindent 4 }} {{- end }} spec: - {{- if and .Values.ingress.className (semverCompare ">=1.18" .Capabilities.KubeVersion.GitVersion) }} + {{- if and .Values.ingress.className $isIngressV1 }} ingressClassName: {{ .Values.ingress.className }} {{- end}} {{- if .Values.ingress.tls }} @@ -31,11 +35,11 @@ spec: http: paths: - path: / - {{- if (semverCompare ">=1.18" $.Capabilities.KubeVersion.GitVersion) }} + {{- if $isIngressV1 }} pathType: "Prefix" {{- end }} backend: - {{- if semverCompare ">=1.19" $.Capabilities.KubeVersion.GitVersion }} + {{- if $isIngressV1 }} service: name: {{ $fullName }} port: @@ -44,4 +48,4 @@ spec: serviceName: {{ $fullName }} servicePort: {{ $svcPort }} {{- end }} -{{- end }} +{{- end }} \ No newline at end of file