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

40 lines
924 B
YAML
Raw Normal View History

2019-11-13 13:56:20 -08:00
apiVersion : kyverno.io/v1
kind : ClusterPolicy
metadata :
name : policy-deployment
spec :
rules:
- name: add-label
2019-07-25 14:57:44 -04:00
match:
resources:
kinds :
- Deployment
selector :
matchLabels :
cli: test
mutate:
patches:
- path: /metadata/labels/isMutated
op: add
value: "true"
- path: /metadata/labels/app
op: replace
value: "nginx_is_mutated"
- name: check-image
2019-07-25 14:57:44 -04:00
match:
resources:
kinds :
- Deployment
selector :
matchLabels :
cli: test
validate:
2019-05-31 16:57:39 -07:00
message: "The imagePullPolicy must be Always when using image nginx"
pattern:
spec:
template:
spec:
containers:
2019-05-31 16:57:39 -07:00
- (image): "nginx*"
imagePullPolicy: Always