Skip to content

Commit

Permalink
fix(charts): set rbac apiVersion without casting
Browse files Browse the repository at this point in the history
  • Loading branch information
Cryptophobia committed Aug 8, 2018
1 parent 0a52fd8 commit c6b75f1
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions charts/monitor/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 c6b75f1

Please sign in to comment.