1
0
Fork 0
mirror of https://github.com/kyverno/kyverno.git synced 2025-03-06 16:06:56 +00:00
kyverno/test/conformance/chainsaw/exceptions/events-creation/policy.yaml
Charles-Edouard Brétéché 6d3dd4f4fe
chore: migrate tests to chainsaw (#8997)
* chore: migrate tests to chainsaw

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* cleanup

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* cleanup

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* fix: exec timeout

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* exceptions

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* exceptions

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* filter

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

---------

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2023-11-24 00:02:22 +00:00

31 lines
991 B
YAML

---
apiVersion: kyverno.io/v1
kind: ClusterPolicy
metadata:
annotations:
policies.kyverno.io/category: Best Practices
policies.kyverno.io/description: 'The '':latest'' tag is mutable and can lead
to unexpected errors if the image changes. A best practice is to use an immutable
tag that maps to a specific version of an application Pod. This policy validates
that the image specifies a tag and that it is not called `latest`. '
policies.kyverno.io/severity: medium
policies.kyverno.io/subject: Pod
policies.kyverno.io/title: Disallow Latest Tag
name: disallow-latest-tag-events-creation
spec:
admission: true
background: true
rules:
- match:
any:
- resources:
kinds:
- Pod
name: validate-image-tag
validate:
message: An image tag is required (:latest is not allowed)
pattern:
spec:
containers:
- image: '!*:latest & *:*'
validationFailureAction: Enforce