From 766b53bf4e21bb2e2ae2b28917e5c2f7da7299fe Mon Sep 17 00:00:00 2001 From: Jaydipkumar Arvindbhai Gabani Date: Mon, 9 Sep 2024 12:57:14 -0700 Subject: [PATCH] fix: liniting error in gatekeeper-controller-manager-poddisruptionbudget.yaml, cherry-pick (#3519) (#3535) Signed-off-by: Thomas Berreis Signed-off-by: Jaydip Gabani Co-authored-by: tberreis <88875030+tberreis@users.noreply.github.com> --- 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: