From f518252aff4f5aa8ac7808405c9c54ef4f85cfbc Mon Sep 17 00:00:00 2001 From: rowanr Date: Fri, 14 Feb 2020 22:21:28 +0100 Subject: [PATCH] [stable/pgadmin] update api versions (#20751) Update Ingress and Deployment apiVersions for Kubernetes 1.16 support Signed-off-by: Rowan Ruseler --- stable/pgadmin/Chart.yaml | 2 +- stable/pgadmin/templates/_helpers.tpl | 22 ++++++++++++++++++++++ stable/pgadmin/templates/deployment.yaml | 2 +- stable/pgadmin/templates/ingress.yaml | 2 +- 4 files changed, 25 insertions(+), 3 deletions(-) diff --git a/stable/pgadmin/Chart.yaml b/stable/pgadmin/Chart.yaml index 34fed2c173..2e5ce60edf 100644 --- a/stable/pgadmin/Chart.yaml +++ b/stable/pgadmin/Chart.yaml @@ -1,7 +1,7 @@ apiVersion: v1 description: pgAdmin is a web based administration tool for PostgreSQL database name: pgadmin -version: 1.1.5 +version: 1.2.0 appVersion: 4.18.0 home: https://www.pgadmin.org/ source: https://github.com/rowanruseler/pgadmin diff --git a/stable/pgadmin/templates/_helpers.tpl b/stable/pgadmin/templates/_helpers.tpl index ed3ae385a0..cad0afa0df 100644 --- a/stable/pgadmin/templates/_helpers.tpl +++ b/stable/pgadmin/templates/_helpers.tpl @@ -61,3 +61,25 @@ Defines a JSON file containing server definitions. This allows connection inform } } {{- end -}} + +{{/* +Return the appropriate apiVersion for deployment. +*/}} +{{- define "deployment.apiVersion" -}} +{{- if semverCompare "<1.9-0" .Capabilities.KubeVersion.GitVersion -}} +{{- print "apps/v1beta2" -}} +{{- else -}} +{{- print "apps/v1" -}} +{{- end -}} +{{- end -}} + +{{/* +Return the appropriate apiVersion for ingress. +*/}} +{{- define "ingress.apiVersion" -}} +{{- if .Capabilities.APIVersions.Has "networking.k8s.io/v1beta1" }} +{{- print "networking.k8s.io/v1beta1" -}} +{{- else -}} +{{- print "extensions/v1beta1" -}} +{{- end -}} +{{- end -}} diff --git a/stable/pgadmin/templates/deployment.yaml b/stable/pgadmin/templates/deployment.yaml index 1042967b6d..b8edf76589 100644 --- a/stable/pgadmin/templates/deployment.yaml +++ b/stable/pgadmin/templates/deployment.yaml @@ -1,5 +1,5 @@ {{- $fullName := include "pgadmin.fullname" . -}} -apiVersion: apps/v1 +apiVersion: {{ template "deployment.apiVersion" . }} kind: Deployment metadata: name: {{ $fullName }} diff --git a/stable/pgadmin/templates/ingress.yaml b/stable/pgadmin/templates/ingress.yaml index e91a254981..d12c3115cd 100644 --- a/stable/pgadmin/templates/ingress.yaml +++ b/stable/pgadmin/templates/ingress.yaml @@ -1,6 +1,6 @@ {{- if .Values.ingress.enabled -}} {{- $fullName := include "pgadmin.fullname" . -}} -apiVersion: extensions/v1beta1 +apiVersion: {{ template "ingress.apiVersion" . }} kind: Ingress metadata: name: {{ $fullName }}