mirror of
https://github.com/kyverno/kyverno.git
synced 2025-03-06 07:57:07 +00:00
* enable matchconditions for reports Signed-off-by: ShutingZhao <shuting@nirmata.com> * update Signed-off-by: ShutingZhao <shuting@nirmata.com> * add chainsaw tests Signed-off-by: ShutingZhao <shuting@nirmata.com> * fix: linter issues Signed-off-by: ShutingZhao <shuting@nirmata.com> * chore: move files Signed-off-by: ShutingZhao <shuting@nirmata.com> --------- Signed-off-by: ShutingZhao <shuting@nirmata.com>
40 lines
No EOL
933 B
YAML
40 lines
No EOL
933 B
YAML
apiVersion: kyverno.io/v1
|
|
kind: ClusterPolicy
|
|
metadata:
|
|
annotations:
|
|
pod-policies.kyverno.io/autogen-controllers: none
|
|
name: cpol-match-conditions-standard
|
|
spec:
|
|
admission: true
|
|
background: true
|
|
webhookConfiguration:
|
|
matchConditions:
|
|
- name: "select-namespace"
|
|
expression: '(object.metadata.namespace == "match-conditions-standard-ns")'
|
|
rules:
|
|
- match:
|
|
any:
|
|
- resources:
|
|
kinds:
|
|
- Pod
|
|
name: require-image-tag
|
|
validate:
|
|
message: An image tag is required
|
|
pattern:
|
|
spec:
|
|
containers:
|
|
- image: '*:*'
|
|
- match:
|
|
any:
|
|
- resources:
|
|
kinds:
|
|
- Pod
|
|
name: validate-image-tag
|
|
validate:
|
|
message: Using a mutable image tag e.g. 'latest' is not allowed
|
|
pattern:
|
|
spec:
|
|
containers:
|
|
- image: '!*:latest'
|
|
validationFailureAction: Enforce
|
|
failurePolicy: Ignore |