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

22 lines
542 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
resource:
2019-05-23 20:37:11 +03:00
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