Skip to content

Commit

Permalink
Check for rbac.authorization.k8s.io/v1 apiVersion
Browse files Browse the repository at this point in the history
  • Loading branch information
lspecian-olx committed May 20, 2021
1 parent fd31fcc commit 5909a60
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions charts/zookeeper-operator/templates/pre-delete-hooks.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
{{- if .Values.hooks.delete }}
kind: ClusterRole
{{- if .Capabilities.APIVersions.Has "rbac.authorization.k8s.io/v1" }}
apiVersion: rbac.authorization.k8s.io/v1
{{- else }}
apiVersion: rbac.authorization.k8s.io/v1beta1
{{- end }}
metadata:
name: {{ template "zookeeper-operator.fullname" . }}-pre-delete
annotations:
Expand All @@ -18,7 +22,11 @@ rules:
---

kind: ClusterRoleBinding
{{- if .Capabilities.APIVersions.Has "rbac.authorization.k8s.io/v1" }}
apiVersion: rbac.authorization.k8s.io/v1
{{- else }}
apiVersion: rbac.authorization.k8s.io/v1beta1
{{- end }}
metadata:
name: {{ template "zookeeper-operator.fullname" . }}-pre-delete
annotations:
Expand Down

0 comments on commit 5909a60

Please sign in to comment.