1
0
Fork 0
mirror of https://github.com/kyverno/kyverno.git synced 2025-03-06 16:06:56 +00:00
kyverno/test/conformance/kuttl/autogen/none/policy.yaml
Charles-Edouard Brétéché 89928e286a
chore: use Audit instead of audit in kuttl tests (#6770)
Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2023-04-03 16:27:21 +00:00

31 lines
670 B
YAML

apiVersion: kyverno.io/v1
kind: ClusterPolicy
metadata:
name: disallow-latest-tag
annotations:
pod-policies.kyverno.io/autogen-controllers: none
spec:
validationFailureAction: Audit
rules:
- match:
resources:
kinds:
- Pod
name: require-image-tag
validate:
message: An image tag is required.
pattern:
spec:
containers:
- image: '*:*'
- match:
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'