Closed jzeng4 closed 12 months ago
If this feature makes sense, we can commit a PR for this feature.
@FillZpp could you prioritize this ticket? thank you!
@jzeng4 maybe your merge behavior can be satisfied with json patch. it may look like this. ` apiVersion: apps.kruise.io/v1alpha1 kind: SidecarSet spec: containers: ... patchPodMetadata:
`
@jzeng4 maybe your merge behavior can be satisfied with json patch. it may look like this. ` apiVersion: apps.kruise.io/v1alpha1 kind: SidecarSet spec: containers: ... patchPodMetadata:
annotations:
- linkedin.com/applications: '[ { "op": "add", "path": "/-", "value": "{ "product":"foo2"}"} , "op": "add", "path": "/-", "value": "{ "product":"bar2"} } ]' patchPolicy: PatchJson
`
@furykerry @jzeng4 Currently sidecarSet controller will call the merge json function when upgrade sidecar in-place, so the above PatchJson will result in repeated element.
If PatchJson is only effective in webhook, the method is ok. So we can skip the jsonPatch in controller. Related Docs:
Related Code: https://github.com/openkruise/kruise/blob/master/pkg/control/sidecarcontrol/util.go#L451
@jzeng4 Can you submit the feature?
sure. will work on that.
sure. will work on that.
plz submit a KEP doc to describe the user case and other technical detail before diving into implementation, my concern includes:
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
What would you like to be added: Currently, pod annotation injection supports the followings:
For MergePatchJson, it only allows to merge non-array annotations. For array annotations, it will did overwrite.
What we need is to merge the annotation array if the annotations have the same key. For example:
Why is this needed: