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
Khaled Emara 2b28538bd3
feat(gctx): add jmespath caching through projections (#11833)
feat(gctx): move ready check to runtime

Signed-off-by: Khaled Emara <khaled.emara@nirmata.com>
Co-authored-by: shuting <shuting@nirmata.com>
2025-02-18 15:51:14 +00:00

33 lines
683 B
YAML
Executable file

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