mirror of
https://github.com/kyverno/kyverno.git
synced 2025-03-06 16:06:56 +00:00
* chore: convert chainsaw tests to Test resource 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>
23 lines
566 B
YAML
Executable file
23 lines
566 B
YAML
Executable file
apiVersion: kyverno.io/v1
|
|
kind: ClusterPolicy
|
|
metadata:
|
|
name: mutate-policy
|
|
spec:
|
|
rules:
|
|
- context:
|
|
- apiCall:
|
|
jmesPath: items[?metadata.name == 'source'].metadata.labels."kyverno.key/copy-me"
|
|
| [0]
|
|
urlPath: /api/v1/namespaces/{{ request.object.metadata.namespace }}/configmaps
|
|
name: labelValue
|
|
match:
|
|
any:
|
|
- resources:
|
|
kinds:
|
|
- ConfigMap
|
|
mutate:
|
|
patchStrategicMerge:
|
|
metadata:
|
|
labels:
|
|
+(kyverno.key/copy-me): '{{ labelValue }}'
|
|
name: gen-role
|