1
0
Fork 0
mirror of https://github.com/kyverno/kyverno.git synced 2025-03-07 08:26:53 +00:00
kyverno/examples/validate/check_image_version.yaml

23 lines
560 B
YAML
Raw Normal View History

apiVersion : kyverno.io/v1alpha1
kind: Policy
metadata:
2019-05-21 00:46:37 -07:00
name: image-pull-policy
spec:
rules:
2019-05-21 00:46:37 -07:00
- name: image-pull-policy
2019-07-25 14:57:44 -04:00
match:
resources:
kinds:
- Deployment
2019-05-23 20:37:11 +03:00
validate:
message: "Image tag ':latest' requires imagePullPolicy 'Always'"
pattern:
2019-05-21 00:46:37 -07:00
spec:
2019-05-23 20:37:11 +03:00
template:
spec:
containers:
2019-05-23 20:42:34 -07:00
# select images which end with :latest
- (image): "*latest"
# require that the imagePullPolicy is "Always"
imagePullPolicy: Always