1
0
Fork 0
mirror of https://github.com/kyverno/kyverno.git synced 2025-01-20 18:52:16 +00:00
kyverno/test/policy/validate/check_image_version.yaml
Charles-Edouard Brétéché 6a43ec4bcf
chore: fix policies (#8449)
Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2023-09-19 10:28:58 +00:00

25 lines
531 B
YAML

---
apiVersion: kyverno.io/v1
kind: ClusterPolicy
metadata:
name: image-pull-policy
spec:
admission: true
background: true
rules:
- match:
any:
- resources:
kinds:
- Deployment
name: image-pull-policy
validate:
message: Image tag ':latest' requires imagePullPolicy 'Always'
pattern:
spec:
template:
spec:
containers:
- (image): '*latest'
imagePullPolicy: Always
validationFailureAction: Audit