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

26 lines
531 B
YAML
Raw Normal View History

---
apiVersion: kyverno.io/v1
kind: ClusterPolicy
2019-07-17 13:31:00 -07:00
metadata:
name: image-pull-policy
spec:
admission: true
background: true
2019-07-17 13:31:00 -07:00
rules:
- match:
any:
- resources:
kinds:
- Deployment
name: image-pull-policy
2019-10-14 12:36:19 -07:00
validate:
message: Image tag ':latest' requires imagePullPolicy 'Always'
2019-10-14 12:36:19 -07:00
pattern:
2019-07-17 13:31:00 -07:00
spec:
template:
spec:
containers:
- (image): '*latest'
2019-10-14 12:36:19 -07:00
imagePullPolicy: Always
validationFailureAction: Audit