longhorn/chart/templates/validate-psp-install.yaml
Phan Le 61d3be3c3b Update PSP validation
Longhorn-5339

Signed-off-by: Phan Le <phan.le@suse.com>
(cherry picked from commit 1deb51287b)
2023-02-07 16:12:43 +08:00

7 lines
367 B
YAML

#{{- if gt (len (lookup "rbac.authorization.k8s.io/v1" "ClusterRole" "" "")) 0 -}}
#{{- if .Values.enablePSP }}
#{{- if not (.Capabilities.APIVersions.Has "policy/v1beta1/PodSecurityPolicy") }}
#{{- fail "The target cluster does not have the PodSecurityPolicy API resource. Please disable PSPs in this chart before proceeding." -}}
#{{- end }}
#{{- end }}
#{{- end }}