1
0
Fork 0
mirror of https://github.com/kyverno/kyverno.git synced 2025-03-06 16:06:56 +00:00
kyverno/test/policy/validate/check_image_version.yaml

23 lines
561 B
YAML
Raw Normal View History

2019-11-13 13:56:20 -08:00
apiVersion : kyverno.io/v1
kind: ClusterPolicy
2019-07-17 13:31:00 -07:00
metadata:
name: image-pull-policy
spec:
rules:
- name: image-pull-policy
2019-07-25 14:57:44 -04:00
match:
resources:
kinds:
- Deployment
2019-10-14 12:36:19 -07:00
validate:
message: "Image tag ':latest' requires imagePullPolicy 'Always'"
pattern:
2019-07-17 13:31:00 -07:00
spec:
template:
spec:
containers:
# select images which end with :latest
- (image): "*latest"
2019-10-14 12:36:19 -07:00
# require that the imagePullPolicy is "Always"
imagePullPolicy: Always