From 1008ae3c4dade3d3b767615d30fdece1b31c2d58 Mon Sep 17 00:00:00 2001 From: Henry Strobel Date: Thu, 12 May 2022 10:45:34 +0200 Subject: [PATCH] Update Ingress to use networking.k8s.io/v1 (#21) --- Chart.yaml | 2 +- templates/ingress.yaml | 15 +++++++++++++-- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/Chart.yaml b/Chart.yaml index 1d5d68a..ad8bd40 100644 --- a/Chart.yaml +++ b/Chart.yaml @@ -1,7 +1,7 @@ --- apiVersion: v2 name: swaggerui -version: 0.3.4 +version: 0.3.5 appVersion: 3.24.3 description: Swagger is an open-source software framework backed by a large ecosystem of tools that helps developers design, build, document, and consume RESTful Web services. keywords: diff --git a/templates/ingress.yaml b/templates/ingress.yaml index aae0095..41a8ec2 100644 --- a/templates/ingress.yaml +++ b/templates/ingress.yaml @@ -2,7 +2,9 @@ {{- if .Values.ingress.enabled }} {{- $fullName := include "swagger-ui.fullname" . -}} {{- $ingressPath := .Values.ingress.path -}} -{{- if .Capabilities.APIVersions.Has "networking.k8s.io/v1beta1" }} +{{- if .Capabilities.APIVersions.Has "networking.k8s.io/v1" }} +apiVersion: networking.k8s.io/v1 +{{ else if .Capabilities.APIVersions.Has "networking.k8s.io/v1beta1" }} apiVersion: networking.k8s.io/v1beta1 {{ else }} apiVersion: extensions/v1beta1 @@ -36,8 +38,17 @@ spec: http: paths: - path: {{ $ingressPath }} +{{- if $.Capabilities.APIVersions.Has "networking.k8s.io/v1" }} + pathType: "ImplementationSpecific" + backend: + service: + name: {{ $fullName }} + port: + name: http +{{- else }} backend: serviceName: {{ $fullName }} servicePort: http - {{- end }} +{{- end }} +{{- end }} {{- end }}