From 6268caf9e80b2e7971fb828b70b99b1985e34831 Mon Sep 17 00:00:00 2001 From: Firgeis Date: Mon, 2 May 2022 15:55:01 -0300 Subject: [PATCH] Allow older policy apiversion --- stable/akv2k8s/templates/env-injector-pdb.yaml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/stable/akv2k8s/templates/env-injector-pdb.yaml b/stable/akv2k8s/templates/env-injector-pdb.yaml index 4aaece3..48f4bc1 100644 --- a/stable/akv2k8s/templates/env-injector-pdb.yaml +++ b/stable/akv2k8s/templates/env-injector-pdb.yaml @@ -1,5 +1,9 @@ {{- if and .Values.env_injector.enabled .Values.env_injector.podDisruptionBudget.enabled }} +{{- if .Capabilities.APIVersions.Has "policy/v1beta1" }} +apiVersion: policy/v1beta1 +{{- else }} apiVersion: policy/v1 +{{- end }} kind: PodDisruptionBudget metadata: name: {{ template "akv2k8s.envinjector.fullname" . }}