From 476cd274a52379eb9b7fd92c89b7a9d697326b60 Mon Sep 17 00:00:00 2001 From: tberreis <88875030+tberreis@users.noreply.github.com> Date: Mon, 9 Sep 2024 18:40:14 +0200 Subject: [PATCH] fix: liniting error in gatekeeper-controller-manager-poddisruptionbudget.yaml (#3519) Signed-off-by: Thomas Berreis Co-authored-by: Jaydipkumar Arvindbhai Gabani (cherry picked from commit 3f457329ebacdb248f2ab2135b188e530362bcf0) Signed-off-by: Jaydip Gabani --- cmd/build/helmify/main.go | 2 +- .../gatekeeper-controller-manager-poddisruptionbudget.yaml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/cmd/build/helmify/main.go b/cmd/build/helmify/main.go index 90563093da2..074c09d5127 100644 --- a/cmd/build/helmify/main.go +++ b/cmd/build/helmify/main.go @@ -157,7 +157,7 @@ func (ks *kindSet) Write() error { } if name == "gatekeeper-controller-manager" && kind == "PodDisruptionBudget" { - obj = strings.Replace(obj, "apiVersion: policy/v1", "{{- $v1 := .Capabilities.APIVersions.Has \"policy/v1/PodDisruptionBudget\" -}}\n{{- $v1beta1 := .Capabilities.APIVersions.Has \"policy/v1beta1/PodDisruptionBudget\" -}}\napiVersion: policy/v1{{- if and (not $v1) $v1beta1 -}}beta1{{- end }}", 1) + obj = strings.Replace(obj, "apiVersion: policy/v1", "{{ $v1 := .Capabilities.APIVersions.Has \"policy/v1/PodDisruptionBudget\" -}}\n{{ $v1beta1 := .Capabilities.APIVersions.Has \"policy/v1beta1/PodDisruptionBudget\" -}}\napiVersion: policy/v1{{- if and (not $v1) $v1beta1 -}}beta1{{- end }}", 1) } if name == "gatekeeper-manager-role" && kind == "ClusterRole" { diff --git a/manifest_staging/charts/gatekeeper/templates/gatekeeper-controller-manager-poddisruptionbudget.yaml b/manifest_staging/charts/gatekeeper/templates/gatekeeper-controller-manager-poddisruptionbudget.yaml index 609270a92de..140c55f8895 100644 --- a/manifest_staging/charts/gatekeeper/templates/gatekeeper-controller-manager-poddisruptionbudget.yaml +++ b/manifest_staging/charts/gatekeeper/templates/gatekeeper-controller-manager-poddisruptionbudget.yaml @@ -1,6 +1,6 @@ --- -{{- $v1 := .Capabilities.APIVersions.Has "policy/v1/PodDisruptionBudget" -}} -{{- $v1beta1 := .Capabilities.APIVersions.Has "policy/v1beta1/PodDisruptionBudget" -}} +{{ $v1 := .Capabilities.APIVersions.Has "policy/v1/PodDisruptionBudget" -}} +{{ $v1beta1 := .Capabilities.APIVersions.Has "policy/v1beta1/PodDisruptionBudget" -}} apiVersion: policy/v1{{- if and (not $v1) $v1beta1 -}}beta1{{- end }} kind: PodDisruptionBudget metadata: