1
0
Fork 0
mirror of https://github.com/kyverno/kyverno.git synced 2025-03-09 09:26:54 +00:00
kyverno/test/conformance/chainsaw/rbac/mutate-policy-with-clusterrole/policy.yaml
Charles-Edouard Brétéché fa36573f85
feat: use more chainsaw test templates (#11285)
* feat: use more chainsaw test templates

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* fix

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

---------

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2024-10-02 15:25:04 +00:00

31 lines
750 B
YAML

apiVersion: kyverno.io/v1
kind: ClusterPolicy
metadata:
name: policy-reload-on-secret-update
spec:
rules:
- name: update-secret
match:
any:
- resources:
kinds:
- Secret
names:
- applicationsecret
preconditions:
all:
- key: "{{ request.operation || 'BACKGROUND' }}"
operator: Equals
value: UPDATE
mutate:
mutateExistingOnPolicyUpdate: false
targets:
- apiVersion: apps/v1
kind: Deployment
name: monitor-grafana
patchStrategicMerge:
spec:
template:
metadata:
annotations:
example.com/triggerrestart: "{{ request.object.metadata.resourceVersion }}"