Repository for dip
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

43 lines
2.7 KiB

{{- if and (eq .Values.cleanupController.enabled true) (eq .Values.crds.groups.kyverno.cleanuppolicies false) }}
{{- fail "CRD cleanuppolicies disabled while cleanupController enabled" }}
{{- end }}
{{- if and (eq .Values.cleanupController.enabled true) (eq .Values.crds.groups.kyverno.clustercleanuppolicies false) }}
{{- fail "CRD clustercleanuppolicies disabled while cleanupController enabled" }}
{{- end }}
{{- if and (eq .Values.reportsController.enabled true) (eq .Values.reportsController.sanityChecks true) (eq .Values.crds.groups.wgpolicyk8s.clusterpolicyreports false) }}
{{- fail "CRD clusterpolicyreports disabled while reportsController enabled" }}
{{- end }}
{{- if and (eq .Values.reportsController.enabled true) (eq .Values.reportsController.sanityChecks true) (eq .Values.crds.groups.wgpolicyk8s.policyreports false) }}
{{- fail "CRD policyreports disabled while reportsController enabled" }}
{{- end }}
{{- if and (eq .Values.reportsController.enabled true) (eq .Values.reportsController.sanityChecks true) (eq .Values.crds.groups.reports.ephemeralreports false) }}
{{- fail "CRD ephemeralreports disabled while reportsController enabled" }}
{{- end }}
{{- if and (eq .Values.reportsController.enabled true) (eq .Values.reportsController.sanityChecks true) (eq .Values.crds.groups.reports.clusterephemeralreports false) }}
{{- fail "CRD clusterephemeralreports disabled while reportsController enabled" }}
{{- end }}
{{- if hasKey .Values "mode" -}}
{{- fail "mode is not supported anymore, please remove it from your release and use admissionController.replicas instead." -}}
{{- end -}}
{{- if eq (include "kyverno.namespace" .) "kube-system" -}}
{{- fail "Kyverno cannot be installed in namespace kube-system." -}}
{{- end -}}
{{- if not .Values.upgrade.fromV2 -}}
{{- $v2 := lookup "apps/v1" "Deployment" (include "kyverno.namespace" .) (include "kyverno.fullname" .) -}}
{{- if $v2 -}}
{{- fail (join "\n" (list
""
""
" +--------------------------------------------------------------------------------------------------------------------------------------+"
" | An earlier Helm installation of Kyverno was detected. |"
" | Given this chart version has significant breaking changes, the upgrade has been blocked. |"
" | Please review the release notes and chart README section and then, once prepared, set `upgrade.fromV2: true` once ready to proceed. |"
" +--------------------------------------------------------------------------------------------------------------------------------------+"
""
))
-}}
{{- end -}}
{{- end -}}