From 2fbd47da561cb80e7f01f38da6a556b63b2579bd Mon Sep 17 00:00:00 2001 From: Brandon Philips Date: Fri, 7 Sep 2018 15:14:50 -0700 Subject: [PATCH] vendor: bump github.com/evanphx/json-patch Grab important bug fix that can cause a `panic()` from this package on certain inputs. See https://github.com/evanphx/json-patch/commit/73af7f547e13ad70d7f7b3388255e7e5eb93adaf Signed-off-by: Brandon Philips --- Godeps/Godeps.json | 4 ++-- .../apiextensions-apiserver/Godeps/Godeps.json | 2 +- staging/src/k8s.io/apimachinery/Godeps/Godeps.json | 2 +- staging/src/k8s.io/apiserver/Godeps/Godeps.json | 2 +- staging/src/k8s.io/cli-runtime/Godeps/Godeps.json | 2 +- .../src/k8s.io/kube-aggregator/Godeps/Godeps.json | 2 +- .../src/k8s.io/sample-apiserver/Godeps/Godeps.json | 2 +- .../k8s.io/sample-cli-plugin/Godeps/Godeps.json | 2 +- vendor/github.com/evanphx/json-patch/patch.go | 14 +++++++------- 9 files changed, 16 insertions(+), 16 deletions(-) diff --git a/Godeps/Godeps.json b/Godeps/Godeps.json index edc85feb6b..ea7adcdab1 100644 --- a/Godeps/Godeps.json +++ b/Godeps/Godeps.json @@ -1522,8 +1522,8 @@ }, { "ImportPath": "github.com/evanphx/json-patch", - "Comment": "v3.0.0-23-g94e38aa", - "Rev": "94e38aa1586e8a6c8a75770bddf5ff84c48a106b" + "Comment": "v3.0.0-29-gf195058", + "Rev": "f195058310bd062ea7c754a834f0ff43b4b63afb" }, { "ImportPath": "github.com/exponent-io/jsonpath", diff --git a/staging/src/k8s.io/apiextensions-apiserver/Godeps/Godeps.json b/staging/src/k8s.io/apiextensions-apiserver/Godeps/Godeps.json index 67af577ddf..11a5666887 100644 --- a/staging/src/k8s.io/apiextensions-apiserver/Godeps/Godeps.json +++ b/staging/src/k8s.io/apiextensions-apiserver/Godeps/Godeps.json @@ -388,7 +388,7 @@ }, { "ImportPath": "github.com/evanphx/json-patch", - "Rev": "94e38aa1586e8a6c8a75770bddf5ff84c48a106b" + "Rev": "f195058310bd062ea7c754a834f0ff43b4b63afb" }, { "ImportPath": "github.com/ghodss/yaml", diff --git a/staging/src/k8s.io/apimachinery/Godeps/Godeps.json b/staging/src/k8s.io/apimachinery/Godeps/Godeps.json index 3a2a7473ff..f0f8a91ae3 100644 --- a/staging/src/k8s.io/apimachinery/Godeps/Godeps.json +++ b/staging/src/k8s.io/apimachinery/Godeps/Godeps.json @@ -24,7 +24,7 @@ }, { "ImportPath": "github.com/evanphx/json-patch", - "Rev": "94e38aa1586e8a6c8a75770bddf5ff84c48a106b" + "Rev": "f195058310bd062ea7c754a834f0ff43b4b63afb" }, { "ImportPath": "github.com/ghodss/yaml", diff --git a/staging/src/k8s.io/apiserver/Godeps/Godeps.json b/staging/src/k8s.io/apiserver/Godeps/Godeps.json index dd782dfba8..a252b24331 100644 --- a/staging/src/k8s.io/apiserver/Godeps/Godeps.json +++ b/staging/src/k8s.io/apiserver/Godeps/Godeps.json @@ -388,7 +388,7 @@ }, { "ImportPath": "github.com/evanphx/json-patch", - "Rev": "94e38aa1586e8a6c8a75770bddf5ff84c48a106b" + "Rev": "f195058310bd062ea7c754a834f0ff43b4b63afb" }, { "ImportPath": "github.com/ghodss/yaml", diff --git a/staging/src/k8s.io/cli-runtime/Godeps/Godeps.json b/staging/src/k8s.io/cli-runtime/Godeps/Godeps.json index e5edf2ebea..856739bfa7 100644 --- a/staging/src/k8s.io/cli-runtime/Godeps/Godeps.json +++ b/staging/src/k8s.io/cli-runtime/Godeps/Godeps.json @@ -12,7 +12,7 @@ }, { "ImportPath": "github.com/evanphx/json-patch", - "Rev": "94e38aa1586e8a6c8a75770bddf5ff84c48a106b" + "Rev": "f195058310bd062ea7c754a834f0ff43b4b63afb" }, { "ImportPath": "github.com/ghodss/yaml", diff --git a/staging/src/k8s.io/kube-aggregator/Godeps/Godeps.json b/staging/src/k8s.io/kube-aggregator/Godeps/Godeps.json index 50eb0dcc61..94c6273588 100644 --- a/staging/src/k8s.io/kube-aggregator/Godeps/Godeps.json +++ b/staging/src/k8s.io/kube-aggregator/Godeps/Godeps.json @@ -128,7 +128,7 @@ }, { "ImportPath": "github.com/evanphx/json-patch", - "Rev": "94e38aa1586e8a6c8a75770bddf5ff84c48a106b" + "Rev": "f195058310bd062ea7c754a834f0ff43b4b63afb" }, { "ImportPath": "github.com/ghodss/yaml", diff --git a/staging/src/k8s.io/sample-apiserver/Godeps/Godeps.json b/staging/src/k8s.io/sample-apiserver/Godeps/Godeps.json index 7d114730b4..9f9bd3a06f 100644 --- a/staging/src/k8s.io/sample-apiserver/Godeps/Godeps.json +++ b/staging/src/k8s.io/sample-apiserver/Godeps/Godeps.json @@ -120,7 +120,7 @@ }, { "ImportPath": "github.com/evanphx/json-patch", - "Rev": "94e38aa1586e8a6c8a75770bddf5ff84c48a106b" + "Rev": "f195058310bd062ea7c754a834f0ff43b4b63afb" }, { "ImportPath": "github.com/ghodss/yaml", diff --git a/staging/src/k8s.io/sample-cli-plugin/Godeps/Godeps.json b/staging/src/k8s.io/sample-cli-plugin/Godeps/Godeps.json index d2e03dfa07..d0d30f26a3 100644 --- a/staging/src/k8s.io/sample-cli-plugin/Godeps/Godeps.json +++ b/staging/src/k8s.io/sample-cli-plugin/Godeps/Godeps.json @@ -8,7 +8,7 @@ "Deps": [ { "ImportPath": "github.com/evanphx/json-patch", - "Rev": "94e38aa1586e8a6c8a75770bddf5ff84c48a106b" + "Rev": "f195058310bd062ea7c754a834f0ff43b4b63afb" }, { "ImportPath": "github.com/ghodss/yaml", diff --git a/vendor/github.com/evanphx/json-patch/patch.go b/vendor/github.com/evanphx/json-patch/patch.go index 1a3aa387ee..d88dc89c33 100644 --- a/vendor/github.com/evanphx/json-patch/patch.go +++ b/vendor/github.com/evanphx/json-patch/patch.go @@ -204,7 +204,7 @@ func (n *lazyNode) equal(o *lazyNode) bool { } func (o operation) kind() string { - if obj, ok := o["op"]; ok { + if obj, ok := o["op"]; ok && obj != nil { var op string err := json.Unmarshal(*obj, &op) @@ -220,7 +220,7 @@ func (o operation) kind() string { } func (o operation) path() string { - if obj, ok := o["path"]; ok { + if obj, ok := o["path"]; ok && obj != nil { var op string err := json.Unmarshal(*obj, &op) @@ -236,7 +236,7 @@ func (o operation) path() string { } func (o operation) from() string { - if obj, ok := o["from"]; ok { + if obj, ok := o["from"]; ok && obj != nil{ var op string err := json.Unmarshal(*obj, &op) @@ -450,7 +450,7 @@ func (p Patch) add(doc *container, op operation) error { con, key := findObject(doc, path) 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()) @@ -462,7 +462,7 @@ func (p Patch) remove(doc *container, op operation) error { con, key := findObject(doc, path) 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) @@ -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) } - val, ok := con.get(key) - if val == nil || ok != nil { + _, ok := con.get(key) + if ok != nil { return fmt.Errorf("jsonpatch replace operation does not apply: doc is missing key: %s", path) }