1
0
Fork 0
mirror of https://github.com/kyverno/kyverno.git synced 2025-04-08 10:04:25 +00:00

fix: allow overriding PDB api version ()

* fix: allow overriding PDB api version

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* changelog

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

---------

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
This commit is contained in:
Charles-Edouard Brétéché 2023-03-28 16:09:47 +02:00 committed by GitHub
parent db29d8b2ba
commit f812335280
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 14 additions and 3 deletions
charts/kyverno

View file

@ -36,3 +36,5 @@ annotations:
description: view aggregated cluster role support
- kind: added
description: support for webhook annotations in config map
- kind: added
description: allow overriding PDB api version

View file

@ -192,6 +192,7 @@ The command removes all the Kubernetes components associated with the chart and
| nameOverride | string | `nil` | Override the name of the chart |
| fullnameOverride | string | `nil` | Override the expanded name of the chart |
| namespaceOverride | string | `nil` | Override the namespace the chart deploys to |
| apiVersionOverride.podDisruptionBudget | string | `nil` | Override api version used to create `PodDisruptionBudget`` resources. When not specified the chart will check if `policy/v1/PodDisruptionBudget` is available to determine the api version automatically. |
| crds.install | bool | `true` | Whether to have Helm install the Kyverno CRDs, if the CRDs are not installed by Helm, they must be added before policies can be created |
| crds.annotations | object | `{}` | Additional CRDs annotations |
| config.create | bool | `true` | Create the configmap. |

View file

@ -1,10 +1,12 @@
{{/* vim: set filetype=mustache: */}}
{{- define "kyverno.pdb.apiVersion" -}}
{{- if .Capabilities.APIVersions.Has "policy/v1/PodDisruptionBudget" -}}
policy/v1
{{- if .Values.apiVersionOverride.podDisruptionBudget -}}
{{- .Values.apiVersionOverride.podDisruptionBudget -}}
{{- else if .Capabilities.APIVersions.Has "policy/v1/PodDisruptionBudget" -}}
policy/v1
{{- else -}}
policy/v1beta1
policy/v1beta1
{{- end -}}
{{- end -}}

View file

@ -14,6 +14,12 @@ fullnameOverride: ~
# -- (string) Override the namespace the chart deploys to
namespaceOverride: ~
apiVersionOverride:
# -- (string) Override api version used to create `PodDisruptionBudget`` resources.
# When not specified the chart will check if `policy/v1/PodDisruptionBudget` is available to
# determine the api version automatically.
podDisruptionBudget: ~
# CRDs configuration
crds: