mirror of
https://github.com/kyverno/kyverno.git
synced 2025-03-09 09:26:54 +00:00
feat(gctx): move ready check to runtime Signed-off-by: Khaled Emara <khaled.emara@nirmata.com> Co-authored-by: shuting <shuting@nirmata.com>
33 lines
683 B
YAML
Executable file
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
|