From 5909a6073c1eaf1d68d2a2e6337580f8df0ef6b5 Mon Sep 17 00:00:00 2001 From: Luis Specian Date: Thu, 20 May 2021 09:14:34 +0200 Subject: [PATCH] Check for rbac.authorization.k8s.io/v1 apiVersion --- charts/zookeeper-operator/templates/pre-delete-hooks.yaml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/charts/zookeeper-operator/templates/pre-delete-hooks.yaml b/charts/zookeeper-operator/templates/pre-delete-hooks.yaml index c36aa6723..432a3f92a 100644 --- a/charts/zookeeper-operator/templates/pre-delete-hooks.yaml +++ b/charts/zookeeper-operator/templates/pre-delete-hooks.yaml @@ -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: @@ -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: