1
0
Fork 0
mirror of https://github.com/kyverno/kyverno.git synced 2025-04-16 09:16:24 +00:00
kyverno/samples/misc/latestimage-notalways.yaml
2020-11-25 11:48:21 -08:00

20 lines
No EOL
472 B
YAML

apiVersion : kyverno.io/v1
kind: ClusterPolicy
metadata:
name: latestimage-notalways
spec:
validationFailureAction: audit
background: false
rules:
- name: latestimage-notalways
match:
resources:
kinds:
- Pod
validate:
message: "When using the `latest` tag, the `imagePullPolicy` must not use `Always`."
pattern:
spec:
containers:
- (image): "*:latest"
imagePullPolicy: "!Always"