From f8b8e513c9c9ccc76aff040fb98a3242fb0fa1b0 Mon Sep 17 00:00:00 2001 From: Cryptophobia Date: Wed, 8 Aug 2018 12:37:27 -0400 Subject: [PATCH] fix(charts): set rbac apiVersion without casting --- charts/workflow-manager/templates/_helpers.tmpl | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/charts/workflow-manager/templates/_helpers.tmpl b/charts/workflow-manager/templates/_helpers.tmpl index f2541e3..422a5ae 100644 --- a/charts/workflow-manager/templates/_helpers.tmpl +++ b/charts/workflow-manager/templates/_helpers.tmpl @@ -1,11 +1,11 @@ {{/* -Set apiVersion based on Kubernetes version +Set apiVersion based on .Capabilities.APIVersions */}} {{- define "rbacAPIVersion" -}} -{{- if (lt (int (.Capabilities.KubeVersion.Minor)) 6) -}} -rbac.authorization.k8s.io/v1alpha1 -{{- else if (and (ge (int (.Capabilities.KubeVersion.Minor)) 6) (le (int (.Capabilities.KubeVersion.Minor)) 7)) -}} +{{- if .Capabilities.APIVersions.Has "rbac.authorization.k8s.io/v1beta1" -}} rbac.authorization.k8s.io/v1beta1 +{{- else if .Capabilities.APIVersions.Has "rbac.authorization.k8s.io/v1alpha1" -}} +rbac.authorization.k8s.io/v1alpha1 {{- else -}} rbac.authorization.k8s.io/v1 {{- end -}}