Skip to content

Commit

Permalink
Merge pull request #45 from Cryptophobia/master
Browse files Browse the repository at this point in the history
fix(charts): set rbac apiVersion without casting
  • Loading branch information
Cryptophobia committed Aug 8, 2018
2 parents b7be0fe + 2612bde commit 6668920
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions charts/builder/templates/_helpers.tmpl
Original file line number Diff line number Diff line change
@@ -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 -}}
Expand Down

0 comments on commit 6668920

Please sign in to comment.