mirror of https://github.com/k3s-io/k3s
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
```
pull/8/head
commit
5af5f1e663
|
@ -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",
|
||||
|
|
|
@ -388,7 +388,7 @@
|
|||
},
|
||||
{
|
||||
"ImportPath": "github.com/evanphx/json-patch",
|
||||
"Rev": "94e38aa1586e8a6c8a75770bddf5ff84c48a106b"
|
||||
"Rev": "f195058310bd062ea7c754a834f0ff43b4b63afb"
|
||||
},
|
||||
{
|
||||
"ImportPath": "github.com/ghodss/yaml",
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
},
|
||||
{
|
||||
"ImportPath": "github.com/evanphx/json-patch",
|
||||
"Rev": "94e38aa1586e8a6c8a75770bddf5ff84c48a106b"
|
||||
"Rev": "f195058310bd062ea7c754a834f0ff43b4b63afb"
|
||||
},
|
||||
{
|
||||
"ImportPath": "github.com/ghodss/yaml",
|
||||
|
|
|
@ -388,7 +388,7 @@
|
|||
},
|
||||
{
|
||||
"ImportPath": "github.com/evanphx/json-patch",
|
||||
"Rev": "94e38aa1586e8a6c8a75770bddf5ff84c48a106b"
|
||||
"Rev": "f195058310bd062ea7c754a834f0ff43b4b63afb"
|
||||
},
|
||||
{
|
||||
"ImportPath": "github.com/ghodss/yaml",
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
},
|
||||
{
|
||||
"ImportPath": "github.com/evanphx/json-patch",
|
||||
"Rev": "94e38aa1586e8a6c8a75770bddf5ff84c48a106b"
|
||||
"Rev": "f195058310bd062ea7c754a834f0ff43b4b63afb"
|
||||
},
|
||||
{
|
||||
"ImportPath": "github.com/ghodss/yaml",
|
||||
|
|
|
@ -128,7 +128,7 @@
|
|||
},
|
||||
{
|
||||
"ImportPath": "github.com/evanphx/json-patch",
|
||||
"Rev": "94e38aa1586e8a6c8a75770bddf5ff84c48a106b"
|
||||
"Rev": "f195058310bd062ea7c754a834f0ff43b4b63afb"
|
||||
},
|
||||
{
|
||||
"ImportPath": "github.com/ghodss/yaml",
|
||||
|
|
|
@ -120,7 +120,7 @@
|
|||
},
|
||||
{
|
||||
"ImportPath": "github.com/evanphx/json-patch",
|
||||
"Rev": "94e38aa1586e8a6c8a75770bddf5ff84c48a106b"
|
||||
"Rev": "f195058310bd062ea7c754a834f0ff43b4b63afb"
|
||||
},
|
||||
{
|
||||
"ImportPath": "github.com/ghodss/yaml",
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
"Deps": [
|
||||
{
|
||||
"ImportPath": "github.com/evanphx/json-patch",
|
||||
"Rev": "94e38aa1586e8a6c8a75770bddf5ff84c48a106b"
|
||||
"Rev": "f195058310bd062ea7c754a834f0ff43b4b63afb"
|
||||
},
|
||||
{
|
||||
"ImportPath": "github.com/ghodss/yaml",
|
||||
|
|
|
@ -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)
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue