mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-20 10:20:51 +00:00
vendor: bump github.com/evanphx/json-patch
Grab important bug fix that can cause a `panic()` from this package on
certain inputs. See 73af7f547e
Signed-off-by: Brandon Philips <brandon@ifup.org>
This commit is contained in:
parent
26403b758b
commit
2fbd47da56
4
Godeps/Godeps.json
generated
4
Godeps/Godeps.json
generated
@ -1522,8 +1522,8 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "github.com/evanphx/json-patch",
|
"ImportPath": "github.com/evanphx/json-patch",
|
||||||
"Comment": "v3.0.0-23-g94e38aa",
|
"Comment": "v3.0.0-29-gf195058",
|
||||||
"Rev": "94e38aa1586e8a6c8a75770bddf5ff84c48a106b"
|
"Rev": "f195058310bd062ea7c754a834f0ff43b4b63afb"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "github.com/exponent-io/jsonpath",
|
"ImportPath": "github.com/exponent-io/jsonpath",
|
||||||
|
@ -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",
|
||||||
|
@ -24,7 +24,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",
|
||||||
|
2
staging/src/k8s.io/apiserver/Godeps/Godeps.json
generated
2
staging/src/k8s.io/apiserver/Godeps/Godeps.json
generated
@ -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",
|
||||||
|
@ -12,7 +12,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",
|
||||||
|
@ -128,7 +128,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",
|
||||||
|
@ -120,7 +120,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",
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
"Deps": [
|
"Deps": [
|
||||||
{
|
{
|
||||||
"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",
|
||||||
|
14
vendor/github.com/evanphx/json-patch/patch.go
generated
vendored
14
vendor/github.com/evanphx/json-patch/patch.go
generated
vendored
@ -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
Block a user