helm: remove obsolete check for network v1 api

The networking.k8s.io/v1beta1 has been obsolete since
K8s 1.22, long out of the supported versions, so we
can remove those legacy checks and require the v1
networking api.

Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
(cherry picked from commit c40477ccc2)
This commit is contained in:
Travis Nielsen authored and Mergify committed 2025-04-08 23:11:41 +00:00
1 parent 065858849f
commit e23aa3c7cc
3 files changed
+2 -27

No files matched your search

@@ -11,14 +11,3 @@ Return the target Kubernetes version.
{{- define "capabilities.kubeVersion" -}}
{{- default .Capabilities.KubeVersion.Version .Values.kubeVersion -}}
{{- end }}
{{/*
Return the appropriate apiVersion for ingress.
*/}}
{{- define "capabilities.ingress.apiVersion" -}}
{{- if semverCompare "<1.19-0" (include "capabilities.kubeVersion" .) -}}
{{- print "networking.k8s.io/v1beta1" -}}
{{- else -}}
{{- print "networking.k8s.io/v1" -}}
{{- end }}
{{- end }}
@@ -1,7 +1,7 @@
{{- range .Values.cephObjectStores }}
{{- if dig "ingress" "enabled" false . }}
---
apiVersion: {{ include "capabilities.ingress.apiVersion" $ }}
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: {{ .name }}
@@ -16,16 +16,11 @@ spec:
paths:
- path: {{ .ingress.host.path | default "/" }}
backend:
{{- if (eq "networking.k8s.io/v1" (include "capabilities.ingress.apiVersion" $)) }}
service:
name: rook-ceph-rgw-{{ .name }}
port:
number: {{ .spec.gateway.securePort | default .spec.gateway.port }}
pathType: {{ .ingress.host.pathType | default "Prefix" }}
{{- else }}
serviceName: rook-ceph-rgw-{{ .name }}
servicePort: {{ .spec.gateway.securePort | default .spec.gateway.port }}
{{- end }}
{{- with .ingress.ingressClassName }}
ingressClassName: {{ . }}
{{- end }}
@@ -1,6 +1,6 @@
{{- if .Values.ingress.dashboard.host }}
---
apiVersion: {{ include "capabilities.ingress.apiVersion" . }}
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: {{ template "clusterName" . }}-dashboard
@@ -15,7 +15,6 @@ spec:
paths:
- path: {{ .Values.ingress.dashboard.host.path | default "/" }}
backend:
{{- if (eq "networking.k8s.io/v1" (include "capabilities.ingress.apiVersion" .)) }}
service:
name: rook-ceph-mgr-dashboard
port:
@@ -25,14 +24,6 @@ spec:
name: http-dashboard
{{- end }}
pathType: {{ .Values.ingress.dashboard.host.pathType | default "Prefix" }}
{{- else }}
serviceName: rook-ceph-mgr-dashboard
{{- if .Values.cephClusterSpec.dashboard.ssl }}
servicePort: https-dashboard
{{- else }}
servicePort: http-dashboard
{{- end }}
{{- end }}
{{- if .Values.ingress.dashboard.ingressClassName }}
ingressClassName: {{ .Values.ingress.dashboard.ingressClassName }}
{{- end }}