1
0
Fork 0
mirror of https://github.com/kyverno/kyverno.git synced 2025-03-09 17:37:12 +00:00
kyverno/test/conformance/chainsaw/globalcontext/apicall-failed/clusterpolicy.yaml

34 lines
683 B
YAML
Raw Normal View History

apiVersion: kyverno.io/v1
kind: ClusterPolicy
metadata:
name: cpol-apicall-failed
spec:
failurePolicy: Fail
rules:
- name: main-deployment-exists
context:
- name: deploymentCount
globalReference:
name: gctxentry-apicall-failed
jmesPath: "length(@)"
match:
all:
- resources:
kinds:
- Pod
preconditions:
all:
- key: '{{ request.operation }}'
operator: AnyIn
value:
- CREATE
- UPDATE
validate:
failureAction: Enforce
deny:
conditions:
any:
- key: "{{ deploymentCount }}"
operator: Equal
value: 0