Hey folks,
we discovered that we get a panic if we apply the following operations to a JSON:
- op: replace, path: "/spec/template/spec/kubeadmConfigSpec/preKubeadmCommands", value: nil
- op: add, path: "/spec/template/spec/kubeadmConfigSpec/preKubeadmCommands/0", value: "some text"
The panic occurs here:
https://github.com/evanphx/json-patch/blob/master/v5/patch.go#L509-L513
I think the problem is that it is only checked if next is nil, but not next.raw. So then it panics in l.513 at *next.raw.