Skip to content

Commit

Permalink
[incubator/buzzfeed-sso] upgrade deprecated Kubernetes APIs (helm#21445)
Browse files Browse the repository at this point in the history
* [incubator/buzzfeed-sso] upgrade deprecated Kubernetes APIs

Signed-off-by: Cameron Attard <[email protected]>

* [incubator/buzzfeed-sso] add template for apiVersion

Signed-off-by: Cameron Attard <[email protected]>
  • Loading branch information
cameronattard authored and includerandom committed Jul 19, 2020
1 parent 2f6f91d commit 35cd272
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 4 deletions.
2 changes: 1 addition & 1 deletion incubator/buzzfeed-sso/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: v1
description: Single sign-on for your Kubernetes services using Google OAuth
name: buzzfeed-sso
version: 0.1.2
version: 0.1.3
appVersion: 2.0.0
home: https://github.com/buzzfeed/sso
sources:
Expand Down
22 changes: 22 additions & 0 deletions incubator/buzzfeed-sso/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,25 @@ Create chart name and version as used by the chart label.
{{- define "buzzfeed-sso.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}}
{{- end -}}

{{/*
Return the apiVersion of deployment.
*/}}
{{- define "deployment.apiVersion" -}}
{{- if .Capabilities.APIVersions.Has "apps/v1" -}}
{{- print "apps/v1" -}}
{{- else -}}
{{- print "apps/v1beta1" -}}
{{- end -}}
{{- end -}}

{{/*
Return the apiVersion of ingress.
*/}}
{{- define "ingress.apiVersion" -}}
{{- if .Capabilities.APIVersions.Has "networking.k8s.io/v1beta1" -}}
{{- print "networking.k8s.io/v1beta1" -}}
{{- else -}}
{{- print "extensions/v1beta1" -}}
{{- end -}}
{{- end -}}
2 changes: 1 addition & 1 deletion incubator/buzzfeed-sso/templates/auth-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
{{- $authSecret := .Values.auth.customSecret | default ($fullName) -}}
{{- $name := include "buzzfeed-sso.name" . -}}
{{- $authDomain := .Values.auth.domain -}}
apiVersion: apps/v1beta1
apiVersion: {{ template "deployment.apiVersion" . }}
kind: Deployment
metadata:
name: {{ $fullName }}-auth
Expand Down
2 changes: 1 addition & 1 deletion incubator/buzzfeed-sso/templates/ingress.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
{{- if ne .Values.auth.domain "<your_auth_domain>" -}}
{{- $fullName := include "buzzfeed-sso.fullname" . -}}
{{- $authDomain := .Values.auth.domain -}}
apiVersion: extensions/v1beta1
apiVersion: {{ template "ingress.apiVersion" . }}
kind: Ingress
metadata:
name: {{ $fullName }}
Expand Down
2 changes: 1 addition & 1 deletion incubator/buzzfeed-sso/templates/proxy-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
{{- $fullName := include "buzzfeed-sso.fullname" . -}}
{{- $proxySecret := .Values.proxy.customSecret | default ($fullName) -}}
{{- $name := include "buzzfeed-sso.name" . -}}
apiVersion: apps/v1beta1
apiVersion: {{ template "deployment.apiVersion" . }}
kind: Deployment
metadata:
name: {{ $fullName }}-proxy
Expand Down

0 comments on commit 35cd272

Please sign in to comment.