mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-10-16 03:59:10 +00:00
Merge pull request #62025 from hanxiaoshuai/bugfix0402
Automatic merge from submit-queue (batch tested with PRs 62025, 63851, 64077, 63967, 63991). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>. check error when parse field failed **What this PR does / why we need it**: check error when parse field failed **Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*: Fixes # **Special notes for your reviewer**: **Release note**: ```release-note NONE ```
This commit is contained in:
@@ -264,13 +264,16 @@ func (r *RuntimeSort) Less(i, j int) bool {
|
||||
iObj := r.objs[i]
|
||||
jObj := r.objs[j]
|
||||
|
||||
parser := jsonpath.New("sorting").AllowMissingKeys(true)
|
||||
parser.Parse(r.field)
|
||||
|
||||
var iValues [][]reflect.Value
|
||||
var jValues [][]reflect.Value
|
||||
var err error
|
||||
|
||||
parser := jsonpath.New("sorting").AllowMissingKeys(true)
|
||||
err = parser.Parse(r.field)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
if unstructured, ok := iObj.(*unstructured.Unstructured); ok {
|
||||
iValues, err = parser.FindResults(unstructured.Object)
|
||||
} else {
|
||||
|
Reference in New Issue
Block a user