Skip to content

Commit e14fc25

Browse files
authored
Merge pull request #4 from Cryptophobia/master
fix(charts): set rbac apiVersion without casting
2 parents 497767d + f8b8e51 commit e14fc25

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

charts/workflow-manager/templates/_helpers.tmpl

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
{{/*
2-
Set apiVersion based on Kubernetes version
2+
Set apiVersion based on .Capabilities.APIVersions
33
*/}}
44
{{- define "rbacAPIVersion" -}}
5-
{{- if (lt (int (.Capabilities.KubeVersion.Minor)) 6) -}}
6-
rbac.authorization.k8s.io/v1alpha1
7-
{{- else if (and (ge (int (.Capabilities.KubeVersion.Minor)) 6) (le (int (.Capabilities.KubeVersion.Minor)) 7)) -}}
5+
{{- if .Capabilities.APIVersions.Has "rbac.authorization.k8s.io/v1beta1" -}}
86
rbac.authorization.k8s.io/v1beta1
7+
{{- else if .Capabilities.APIVersions.Has "rbac.authorization.k8s.io/v1alpha1" -}}
8+
rbac.authorization.k8s.io/v1alpha1
99
{{- else -}}
1010
rbac.authorization.k8s.io/v1
1111
{{- end -}}

0 commit comments

Comments
 (0)