Improve error handling for json path results

This commit is contained in:
Joe Betz 2024-02-28 16:22:34 -05:00
parent 61d6026d23
commit a0dc949ce3

View File

@ -363,7 +363,7 @@ func (a customResourceStrategy) selectableFields(obj runtime.Object, objectMeta
}
var value any
if len(results) > 0 && len(results[0]) == 1 {
if len(results) > 0 && len(results[0]) > 0 {
if len(results) > 1 || len(results[0]) > 1 {
return nil, fmt.Errorf("unexpectedly received more than one JSON path result")
}