Merge pull request #68428 from philips/bump-json-patch
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions here: https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md.
vendor: bump github.com/evanphx/json-patch
Grab important bug fix that can cause a `panic()` from this package on
certain inputs. See 73af7f547e
```release-note
NONE
```
Kubernetes-commit: 5af5f1e66353a50a848a4017c1fba6a39f12584c
This commit is contained in:
commit
e73ba2ce12
|
|
@ -388,7 +388,7 @@
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "github.com/evanphx/json-patch",
|
"ImportPath": "github.com/evanphx/json-patch",
|
||||||
"Rev": "94e38aa1586e8a6c8a75770bddf5ff84c48a106b"
|
"Rev": "f195058310bd062ea7c754a834f0ff43b4b63afb"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "github.com/ghodss/yaml",
|
"ImportPath": "github.com/ghodss/yaml",
|
||||||
|
|
@ -984,215 +984,215 @@
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/apimachinery/pkg/api/apitesting",
|
"ImportPath": "k8s.io/apimachinery/pkg/api/apitesting",
|
||||||
"Rev": "cdac837abb323d610ee074068a16915651f888dd"
|
"Rev": "0dbe21f815eb26c3e48873dbc609191001553a3c"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/apimachinery/pkg/api/apitesting/fuzzer",
|
"ImportPath": "k8s.io/apimachinery/pkg/api/apitesting/fuzzer",
|
||||||
"Rev": "cdac837abb323d610ee074068a16915651f888dd"
|
"Rev": "0dbe21f815eb26c3e48873dbc609191001553a3c"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/apimachinery/pkg/api/apitesting/roundtrip",
|
"ImportPath": "k8s.io/apimachinery/pkg/api/apitesting/roundtrip",
|
||||||
"Rev": "cdac837abb323d610ee074068a16915651f888dd"
|
"Rev": "0dbe21f815eb26c3e48873dbc609191001553a3c"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/apimachinery/pkg/api/equality",
|
"ImportPath": "k8s.io/apimachinery/pkg/api/equality",
|
||||||
"Rev": "cdac837abb323d610ee074068a16915651f888dd"
|
"Rev": "0dbe21f815eb26c3e48873dbc609191001553a3c"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/apimachinery/pkg/api/errors",
|
"ImportPath": "k8s.io/apimachinery/pkg/api/errors",
|
||||||
"Rev": "cdac837abb323d610ee074068a16915651f888dd"
|
"Rev": "0dbe21f815eb26c3e48873dbc609191001553a3c"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/apimachinery/pkg/api/meta",
|
"ImportPath": "k8s.io/apimachinery/pkg/api/meta",
|
||||||
"Rev": "cdac837abb323d610ee074068a16915651f888dd"
|
"Rev": "0dbe21f815eb26c3e48873dbc609191001553a3c"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/apimachinery/pkg/api/resource",
|
"ImportPath": "k8s.io/apimachinery/pkg/api/resource",
|
||||||
"Rev": "cdac837abb323d610ee074068a16915651f888dd"
|
"Rev": "0dbe21f815eb26c3e48873dbc609191001553a3c"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/apimachinery/pkg/api/validation",
|
"ImportPath": "k8s.io/apimachinery/pkg/api/validation",
|
||||||
"Rev": "cdac837abb323d610ee074068a16915651f888dd"
|
"Rev": "0dbe21f815eb26c3e48873dbc609191001553a3c"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/apimachinery/pkg/api/validation/path",
|
"ImportPath": "k8s.io/apimachinery/pkg/api/validation/path",
|
||||||
"Rev": "cdac837abb323d610ee074068a16915651f888dd"
|
"Rev": "0dbe21f815eb26c3e48873dbc609191001553a3c"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/apimachinery/pkg/apis/meta/fuzzer",
|
"ImportPath": "k8s.io/apimachinery/pkg/apis/meta/fuzzer",
|
||||||
"Rev": "cdac837abb323d610ee074068a16915651f888dd"
|
"Rev": "0dbe21f815eb26c3e48873dbc609191001553a3c"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/apimachinery/pkg/apis/meta/internalversion",
|
"ImportPath": "k8s.io/apimachinery/pkg/apis/meta/internalversion",
|
||||||
"Rev": "cdac837abb323d610ee074068a16915651f888dd"
|
"Rev": "0dbe21f815eb26c3e48873dbc609191001553a3c"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/apimachinery/pkg/apis/meta/v1",
|
"ImportPath": "k8s.io/apimachinery/pkg/apis/meta/v1",
|
||||||
"Rev": "cdac837abb323d610ee074068a16915651f888dd"
|
"Rev": "0dbe21f815eb26c3e48873dbc609191001553a3c"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured",
|
"ImportPath": "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured",
|
||||||
"Rev": "cdac837abb323d610ee074068a16915651f888dd"
|
"Rev": "0dbe21f815eb26c3e48873dbc609191001553a3c"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/apimachinery/pkg/apis/meta/v1/validation",
|
"ImportPath": "k8s.io/apimachinery/pkg/apis/meta/v1/validation",
|
||||||
"Rev": "cdac837abb323d610ee074068a16915651f888dd"
|
"Rev": "0dbe21f815eb26c3e48873dbc609191001553a3c"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/apimachinery/pkg/apis/meta/v1beta1",
|
"ImportPath": "k8s.io/apimachinery/pkg/apis/meta/v1beta1",
|
||||||
"Rev": "cdac837abb323d610ee074068a16915651f888dd"
|
"Rev": "0dbe21f815eb26c3e48873dbc609191001553a3c"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/apimachinery/pkg/conversion",
|
"ImportPath": "k8s.io/apimachinery/pkg/conversion",
|
||||||
"Rev": "cdac837abb323d610ee074068a16915651f888dd"
|
"Rev": "0dbe21f815eb26c3e48873dbc609191001553a3c"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/apimachinery/pkg/conversion/queryparams",
|
"ImportPath": "k8s.io/apimachinery/pkg/conversion/queryparams",
|
||||||
"Rev": "cdac837abb323d610ee074068a16915651f888dd"
|
"Rev": "0dbe21f815eb26c3e48873dbc609191001553a3c"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/apimachinery/pkg/fields",
|
"ImportPath": "k8s.io/apimachinery/pkg/fields",
|
||||||
"Rev": "cdac837abb323d610ee074068a16915651f888dd"
|
"Rev": "0dbe21f815eb26c3e48873dbc609191001553a3c"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/apimachinery/pkg/labels",
|
"ImportPath": "k8s.io/apimachinery/pkg/labels",
|
||||||
"Rev": "cdac837abb323d610ee074068a16915651f888dd"
|
"Rev": "0dbe21f815eb26c3e48873dbc609191001553a3c"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/apimachinery/pkg/runtime",
|
"ImportPath": "k8s.io/apimachinery/pkg/runtime",
|
||||||
"Rev": "cdac837abb323d610ee074068a16915651f888dd"
|
"Rev": "0dbe21f815eb26c3e48873dbc609191001553a3c"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/apimachinery/pkg/runtime/schema",
|
"ImportPath": "k8s.io/apimachinery/pkg/runtime/schema",
|
||||||
"Rev": "cdac837abb323d610ee074068a16915651f888dd"
|
"Rev": "0dbe21f815eb26c3e48873dbc609191001553a3c"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer",
|
"ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer",
|
||||||
"Rev": "cdac837abb323d610ee074068a16915651f888dd"
|
"Rev": "0dbe21f815eb26c3e48873dbc609191001553a3c"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer/json",
|
"ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer/json",
|
||||||
"Rev": "cdac837abb323d610ee074068a16915651f888dd"
|
"Rev": "0dbe21f815eb26c3e48873dbc609191001553a3c"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer/protobuf",
|
"ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer/protobuf",
|
||||||
"Rev": "cdac837abb323d610ee074068a16915651f888dd"
|
"Rev": "0dbe21f815eb26c3e48873dbc609191001553a3c"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer/recognizer",
|
"ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer/recognizer",
|
||||||
"Rev": "cdac837abb323d610ee074068a16915651f888dd"
|
"Rev": "0dbe21f815eb26c3e48873dbc609191001553a3c"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer/streaming",
|
"ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer/streaming",
|
||||||
"Rev": "cdac837abb323d610ee074068a16915651f888dd"
|
"Rev": "0dbe21f815eb26c3e48873dbc609191001553a3c"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer/versioning",
|
"ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer/versioning",
|
||||||
"Rev": "cdac837abb323d610ee074068a16915651f888dd"
|
"Rev": "0dbe21f815eb26c3e48873dbc609191001553a3c"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/apimachinery/pkg/selection",
|
"ImportPath": "k8s.io/apimachinery/pkg/selection",
|
||||||
"Rev": "cdac837abb323d610ee074068a16915651f888dd"
|
"Rev": "0dbe21f815eb26c3e48873dbc609191001553a3c"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/apimachinery/pkg/types",
|
"ImportPath": "k8s.io/apimachinery/pkg/types",
|
||||||
"Rev": "cdac837abb323d610ee074068a16915651f888dd"
|
"Rev": "0dbe21f815eb26c3e48873dbc609191001553a3c"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/apimachinery/pkg/util/cache",
|
"ImportPath": "k8s.io/apimachinery/pkg/util/cache",
|
||||||
"Rev": "cdac837abb323d610ee074068a16915651f888dd"
|
"Rev": "0dbe21f815eb26c3e48873dbc609191001553a3c"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/apimachinery/pkg/util/clock",
|
"ImportPath": "k8s.io/apimachinery/pkg/util/clock",
|
||||||
"Rev": "cdac837abb323d610ee074068a16915651f888dd"
|
"Rev": "0dbe21f815eb26c3e48873dbc609191001553a3c"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/apimachinery/pkg/util/diff",
|
"ImportPath": "k8s.io/apimachinery/pkg/util/diff",
|
||||||
"Rev": "cdac837abb323d610ee074068a16915651f888dd"
|
"Rev": "0dbe21f815eb26c3e48873dbc609191001553a3c"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/apimachinery/pkg/util/errors",
|
"ImportPath": "k8s.io/apimachinery/pkg/util/errors",
|
||||||
"Rev": "cdac837abb323d610ee074068a16915651f888dd"
|
"Rev": "0dbe21f815eb26c3e48873dbc609191001553a3c"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/apimachinery/pkg/util/framer",
|
"ImportPath": "k8s.io/apimachinery/pkg/util/framer",
|
||||||
"Rev": "cdac837abb323d610ee074068a16915651f888dd"
|
"Rev": "0dbe21f815eb26c3e48873dbc609191001553a3c"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/apimachinery/pkg/util/intstr",
|
"ImportPath": "k8s.io/apimachinery/pkg/util/intstr",
|
||||||
"Rev": "cdac837abb323d610ee074068a16915651f888dd"
|
"Rev": "0dbe21f815eb26c3e48873dbc609191001553a3c"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/apimachinery/pkg/util/json",
|
"ImportPath": "k8s.io/apimachinery/pkg/util/json",
|
||||||
"Rev": "cdac837abb323d610ee074068a16915651f888dd"
|
"Rev": "0dbe21f815eb26c3e48873dbc609191001553a3c"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/apimachinery/pkg/util/mergepatch",
|
"ImportPath": "k8s.io/apimachinery/pkg/util/mergepatch",
|
||||||
"Rev": "cdac837abb323d610ee074068a16915651f888dd"
|
"Rev": "0dbe21f815eb26c3e48873dbc609191001553a3c"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/apimachinery/pkg/util/naming",
|
"ImportPath": "k8s.io/apimachinery/pkg/util/naming",
|
||||||
"Rev": "cdac837abb323d610ee074068a16915651f888dd"
|
"Rev": "0dbe21f815eb26c3e48873dbc609191001553a3c"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/apimachinery/pkg/util/net",
|
"ImportPath": "k8s.io/apimachinery/pkg/util/net",
|
||||||
"Rev": "cdac837abb323d610ee074068a16915651f888dd"
|
"Rev": "0dbe21f815eb26c3e48873dbc609191001553a3c"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/apimachinery/pkg/util/rand",
|
"ImportPath": "k8s.io/apimachinery/pkg/util/rand",
|
||||||
"Rev": "cdac837abb323d610ee074068a16915651f888dd"
|
"Rev": "0dbe21f815eb26c3e48873dbc609191001553a3c"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/apimachinery/pkg/util/runtime",
|
"ImportPath": "k8s.io/apimachinery/pkg/util/runtime",
|
||||||
"Rev": "cdac837abb323d610ee074068a16915651f888dd"
|
"Rev": "0dbe21f815eb26c3e48873dbc609191001553a3c"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/apimachinery/pkg/util/sets",
|
"ImportPath": "k8s.io/apimachinery/pkg/util/sets",
|
||||||
"Rev": "cdac837abb323d610ee074068a16915651f888dd"
|
"Rev": "0dbe21f815eb26c3e48873dbc609191001553a3c"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/apimachinery/pkg/util/strategicpatch",
|
"ImportPath": "k8s.io/apimachinery/pkg/util/strategicpatch",
|
||||||
"Rev": "cdac837abb323d610ee074068a16915651f888dd"
|
"Rev": "0dbe21f815eb26c3e48873dbc609191001553a3c"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/apimachinery/pkg/util/uuid",
|
"ImportPath": "k8s.io/apimachinery/pkg/util/uuid",
|
||||||
"Rev": "cdac837abb323d610ee074068a16915651f888dd"
|
"Rev": "0dbe21f815eb26c3e48873dbc609191001553a3c"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/apimachinery/pkg/util/validation",
|
"ImportPath": "k8s.io/apimachinery/pkg/util/validation",
|
||||||
"Rev": "cdac837abb323d610ee074068a16915651f888dd"
|
"Rev": "0dbe21f815eb26c3e48873dbc609191001553a3c"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/apimachinery/pkg/util/validation/field",
|
"ImportPath": "k8s.io/apimachinery/pkg/util/validation/field",
|
||||||
"Rev": "cdac837abb323d610ee074068a16915651f888dd"
|
"Rev": "0dbe21f815eb26c3e48873dbc609191001553a3c"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/apimachinery/pkg/util/wait",
|
"ImportPath": "k8s.io/apimachinery/pkg/util/wait",
|
||||||
"Rev": "cdac837abb323d610ee074068a16915651f888dd"
|
"Rev": "0dbe21f815eb26c3e48873dbc609191001553a3c"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/apimachinery/pkg/util/waitgroup",
|
"ImportPath": "k8s.io/apimachinery/pkg/util/waitgroup",
|
||||||
"Rev": "cdac837abb323d610ee074068a16915651f888dd"
|
"Rev": "0dbe21f815eb26c3e48873dbc609191001553a3c"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/apimachinery/pkg/util/yaml",
|
"ImportPath": "k8s.io/apimachinery/pkg/util/yaml",
|
||||||
"Rev": "cdac837abb323d610ee074068a16915651f888dd"
|
"Rev": "0dbe21f815eb26c3e48873dbc609191001553a3c"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/apimachinery/pkg/version",
|
"ImportPath": "k8s.io/apimachinery/pkg/version",
|
||||||
"Rev": "cdac837abb323d610ee074068a16915651f888dd"
|
"Rev": "0dbe21f815eb26c3e48873dbc609191001553a3c"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/apimachinery/pkg/watch",
|
"ImportPath": "k8s.io/apimachinery/pkg/watch",
|
||||||
"Rev": "cdac837abb323d610ee074068a16915651f888dd"
|
"Rev": "0dbe21f815eb26c3e48873dbc609191001553a3c"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/apimachinery/third_party/forked/golang/json",
|
"ImportPath": "k8s.io/apimachinery/third_party/forked/golang/json",
|
||||||
"Rev": "cdac837abb323d610ee074068a16915651f888dd"
|
"Rev": "0dbe21f815eb26c3e48873dbc609191001553a3c"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/apimachinery/third_party/forked/golang/reflect",
|
"ImportPath": "k8s.io/apimachinery/third_party/forked/golang/reflect",
|
||||||
"Rev": "cdac837abb323d610ee074068a16915651f888dd"
|
"Rev": "0dbe21f815eb26c3e48873dbc609191001553a3c"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/client-go/discovery",
|
"ImportPath": "k8s.io/client-go/discovery",
|
||||||
|
|
|
||||||
|
|
@ -204,7 +204,7 @@ func (n *lazyNode) equal(o *lazyNode) bool {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (o operation) kind() string {
|
func (o operation) kind() string {
|
||||||
if obj, ok := o["op"]; ok {
|
if obj, ok := o["op"]; ok && obj != nil {
|
||||||
var op string
|
var op string
|
||||||
|
|
||||||
err := json.Unmarshal(*obj, &op)
|
err := json.Unmarshal(*obj, &op)
|
||||||
|
|
@ -220,7 +220,7 @@ func (o operation) kind() string {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (o operation) path() string {
|
func (o operation) path() string {
|
||||||
if obj, ok := o["path"]; ok {
|
if obj, ok := o["path"]; ok && obj != nil {
|
||||||
var op string
|
var op string
|
||||||
|
|
||||||
err := json.Unmarshal(*obj, &op)
|
err := json.Unmarshal(*obj, &op)
|
||||||
|
|
@ -236,7 +236,7 @@ func (o operation) path() string {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (o operation) from() string {
|
func (o operation) from() string {
|
||||||
if obj, ok := o["from"]; ok {
|
if obj, ok := o["from"]; ok && obj != nil{
|
||||||
var op string
|
var op string
|
||||||
|
|
||||||
err := json.Unmarshal(*obj, &op)
|
err := json.Unmarshal(*obj, &op)
|
||||||
|
|
@ -450,7 +450,7 @@ func (p Patch) add(doc *container, op operation) error {
|
||||||
con, key := findObject(doc, path)
|
con, key := findObject(doc, path)
|
||||||
|
|
||||||
if con == nil {
|
if con == nil {
|
||||||
return fmt.Errorf("jsonpatch add operation does not apply: doc is missing path: %s", path)
|
return fmt.Errorf("jsonpatch add operation does not apply: doc is missing path: \"%s\"", path)
|
||||||
}
|
}
|
||||||
|
|
||||||
return con.add(key, op.value())
|
return con.add(key, op.value())
|
||||||
|
|
@ -462,7 +462,7 @@ func (p Patch) remove(doc *container, op operation) error {
|
||||||
con, key := findObject(doc, path)
|
con, key := findObject(doc, path)
|
||||||
|
|
||||||
if con == nil {
|
if con == nil {
|
||||||
return fmt.Errorf("jsonpatch remove operation does not apply: doc is missing path: %s", path)
|
return fmt.Errorf("jsonpatch remove operation does not apply: doc is missing path: \"%s\"", path)
|
||||||
}
|
}
|
||||||
|
|
||||||
return con.remove(key)
|
return con.remove(key)
|
||||||
|
|
@ -477,8 +477,8 @@ func (p Patch) replace(doc *container, op operation) error {
|
||||||
return fmt.Errorf("jsonpatch replace operation does not apply: doc is missing path: %s", path)
|
return fmt.Errorf("jsonpatch replace operation does not apply: doc is missing path: %s", path)
|
||||||
}
|
}
|
||||||
|
|
||||||
val, ok := con.get(key)
|
_, ok := con.get(key)
|
||||||
if val == nil || ok != nil {
|
if ok != nil {
|
||||||
return fmt.Errorf("jsonpatch replace operation does not apply: doc is missing key: %s", path)
|
return fmt.Errorf("jsonpatch replace operation does not apply: doc is missing key: %s", path)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue