OpenShift APIs are sometimes deprecated and removed after a few releases. As a best practice, older API versions should be replaced with newer versions. This policy validates for APIs that are deprecated or scheduled for removal. Note that checking for some of these resources may require modifying the Kyverno ConfigMap to remove filters.
apiVersion: kyverno.io/v1kind: ClusterPolicymetadata:name: disallow-deprecated-apisannotations:policies.kyverno.io/title: Disallow deprecated APIspolicies.kyverno.io/category: OpenShiftpolicies.kyverno.io/severity: mediumkyverno.io/kyverno-version: 1.6.0policies.kyverno.io/minversion: 1.6.0kyverno.io/kubernetes-version: "1.20"policies.kyverno.io/subject: ClusterRole,ClusterRoleBinding,Role,RoleBinding,RBACpolicies.kyverno.io/description: "OpenShift APIs are sometimes deprecated and removed after a few releases. As a best practice, older API versions should be replaced with newer versions. This policy validates for APIs that are deprecated or scheduled for removal. Note that checking for some of these resources may require modifying the Kyverno ConfigMap to remove filters. "spec:validationFailureAction: Enforcebackground: truerules:- name: check-deprecated-apismatch:any:- resources:kinds:- authorization.openshift.io/v1/ClusterRole- authorization.openshift.io/v1/ClusterRoleBinding- authorization.openshift.io/v1/Role- authorization.openshift.io/v1/RoleBindingvalidate:message: "{{ request.object.apiVersion }}/{{ request.object.kind }} is deprecated."deny: {}
This policy performs some best practices validation on Application fields. Path or chart must be specified but never both. And destination.name or destination.server must be specified but never both.
This policy prevents the use of the default project in an Application.
This policy prevents updates to the project field after an Application is created.