-
Notifications
You must be signed in to change notification settings - Fork 32
Open
Labels
enhancementNew feature or requestNew feature or request
Description
While defining custom data in ConfigMap it is possible to define JSON path operation (add, remove, replace, copy, move). Those operation are not taken into account by NRI.
For instance for ConfigMap
apiVersion: v1
kind: ConfigMap
metadata:
name: nri-user-defined-injections
namespace: kube-system
data:
"customInjection": '{"op": "remove", "path": "/metadata/annotations", "value": {"k8s.v1.cni.cncf.io/networks": "foo-network"}}'
Original POD specification is not modified
apiVersion: v1
kind: Pod
metadata:
name: testpod
labels:
customInjection: "true"
annotations:
k8s.v1.cni.cncf.io/networks: foo-network
spec:
containers:
- name: app
image: alpine
command: [ "/bin/sh", "-c", "sleep INF" ]
Expected to remove foo-network from POD specification.
Second use case, for ConfigMap, operation add
apiVersion: v1
kind: ConfigMap
metadata:
name: nri-user-defined-injections
namespace: kube-system
data:
"customInjection": '{"op": "add", "path": "/metadata/annotations", "value": {"k8s.v1.cni.cncf.io/networks": "sriov-net-attach-def"}}'
and above POD definition, I would expect for operation add to have after modification two networks
k8s.v1.cni.cncf.io/networks: foo-network, sriov-net-attach-def
instead for given key, values are replaced. Current state:
k8s.v1.cni.cncf.io/networks: sriov-net-attach-def
zshi-redhat
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request