add back support for ingress in k8s < 1.14 (#20591)

Signed-off-by: George Kaz <egeorgekaz@gmail.com>
This commit is contained in:
georgekaz
2020-02-07 01:01:42 -08:00
committed by GitHub
parent 1d07dadf21
commit 09ff371ed6
3 changed files with 13 additions and 2 deletions
+1 -1
View File
@@ -2,7 +2,7 @@ apiVersion: v1
name: drone
home: https://drone.io/
icon: https://drone.io/apple-touch-icon.png
version: 2.6.0
version: 2.6.1
appVersion: 1.6.1
description: Drone is a Continuous Delivery system built on container technology
keywords:
+11
View File
@@ -69,3 +69,14 @@ Create the name of the secret for an enterprise license key
{{ printf "%s-%s" (include "drone.fullname" .) "license-key" | trunc 63 }}
{{- end -}}
{{- end -}}
{{/*
Return the appropriate apiVersion for ingress.
*/}}
{{- define "drone.ingress.apiVersion" -}}
{{- if semverCompare "<1.14-0" .Capabilities.KubeVersion.GitVersion -}}
{{- print "extensions/v1beta1" -}}
{{- else if semverCompare "^1.14-0" .Capabilities.KubeVersion.GitVersion -}}
{{- print "networking.k8s.io/v1beta1" -}}
{{- end -}}
{{- end -}}
+1 -1
View File
@@ -1,7 +1,7 @@
{{- if .Values.ingress.enabled -}}
{{- $fullName := include "drone.fullname" . }}
{{- $httpPort := .Values.service.httpPort }}
apiVersion: networking.k8s.io/v1beta1
apiVersion: {{ template "drone.ingress.apiVersion" . }}
kind: Ingress
metadata:
annotations: