mirror of
https://github.com/kyverno/kyverno.git
synced 2025-03-10 01:46:55 +00:00
* feat: support celexceptions in the CLI Signed-off-by: Mariam Fahmy <mariam.fahmy@nirmata.com> * feat: add unit tests Signed-off-by: Mariam Fahmy <mariam.fahmy@nirmata.com> --------- Signed-off-by: Mariam Fahmy <mariam.fahmy@nirmata.com>
33 lines
No EOL
692 B
YAML
33 lines
No EOL
692 B
YAML
apiVersion: policies.kyverno.io/v1alpha1
|
|
kind: CELPolicyException
|
|
metadata:
|
|
name: pod-security-exception
|
|
spec:
|
|
policyRefs:
|
|
- name: "check-deployment-labels"
|
|
kind: ValidatingPolicy
|
|
matchConditions:
|
|
- name: "check-namespace"
|
|
expression: "object.metadata.namespace == 'test-ns'"
|
|
---
|
|
apiVersion: kyverno.io/v2
|
|
kind: PolicyException
|
|
metadata:
|
|
name: delta-exception
|
|
namespace: delta
|
|
spec:
|
|
exceptions:
|
|
- policyName: disallow-host-namespaces
|
|
ruleNames:
|
|
- host-namespaces
|
|
- autogen-host-namespaces
|
|
match:
|
|
any:
|
|
- resources:
|
|
kinds:
|
|
- Pod
|
|
- Deployment
|
|
namespaces:
|
|
- delta
|
|
names:
|
|
- important-tool* |