1
0
Fork 0
mirror of https://github.com/kyverno/kyverno.git synced 2025-03-22 07:41:10 +00:00
kyverno/test/conformance/chainsaw/globalcontext/gctxentry-not-exist/clusterpolicy.yaml
刘旭 8b4f222860
fix(gctx): fix gctx projection cache (#12226)
Signed-off-by: liuxu <liuxu623@gmail.com>
Co-authored-by: shuting <shuting@nirmata.com>
2025-02-27 08:23:23 +00:00

35 lines
754 B
YAML
Executable file

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