2019-11-13 13:56:20 -08:00
|
|
|
apiVersion : kyverno.io/v1
|
2019-09-03 14:51:51 -07:00
|
|
|
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
|