open-policy-agent / gatekeeper

🐊 Gatekeeper - Policy Controller for Kubernetes
https://open-policy-agent.github.io/gatekeeper/
Apache License 2.0
3.73k stars 765 forks source link

Helm chart - lint failure in templates/gatekeeper-controller-manager-poddisruptionbudget.yaml #3527

Closed cwstrommer closed 2 months ago

cwstrommer commented 2 months ago

What steps did you take and what happened:

helm pull --repo https://open-policy-agent.github.io/gatekeeper/charts gatekeeper
tar xvzf gatekeeper-3.17.0.tgz
cd gatekeeper
helm lint .

produces

==> Linting .
[ERROR] templates/gatekeeper-controller-manager-poddisruptionbudget.yaml: unable to parse YAML: invalid Yaml document separator: apiVersion: policy/v1

Error: 1 chart(s) linted, 1 chart(s) failed

What did you expect to happen:

No lint error.

Anything else you would like to add:

Changing lines 2 and 3 from

{{- $v1 := .Capabilities.APIVersions.Has "policy/v1/PodDisruptionBudget" -}}
{{- $v1beta1 := .Capabilities.APIVersions.Has "policy/v1beta1/PodDisruptionBudget" -}}

to

{{- $v1 := .Capabilities.APIVersions.Has "policy/v1/PodDisruptionBudget" }}
{{- $v1beta1 := .Capabilities.APIVersions.Has "policy/v1beta1/PodDisruptionBudget" }}

Resolves the linting error.

Environment:

JaydipGabani commented 2 months ago

@cwstrommer This is fixed in 3.17.1. Please try it out and feel free to open the issue if need be.