mirror of
https://github.com/rancher/steve.git
synced 2025-07-11 05:43:24 +00:00
Ensure complex accessors from schema don't result in double-bracketing. (#531)
This commit is contained in:
parent
2711fd1f46
commit
2f331b1a1a
@ -15,6 +15,7 @@ import (
|
|||||||
"sync"
|
"sync"
|
||||||
|
|
||||||
"github.com/pkg/errors"
|
"github.com/pkg/errors"
|
||||||
|
"github.com/rancher/steve/pkg/stores/queryhelper"
|
||||||
"github.com/sirupsen/logrus"
|
"github.com/sirupsen/logrus"
|
||||||
"golang.org/x/sync/errgroup"
|
"golang.org/x/sync/errgroup"
|
||||||
"k8s.io/apimachinery/pkg/api/meta"
|
"k8s.io/apimachinery/pkg/api/meta"
|
||||||
@ -371,7 +372,7 @@ func getFieldsFromSchema(schema *types.APISchema) [][]string {
|
|||||||
}
|
}
|
||||||
for _, colDef := range colDefs {
|
for _, colDef := range colDefs {
|
||||||
field := strings.TrimPrefix(colDef.Field, "$.")
|
field := strings.TrimPrefix(colDef.Field, "$.")
|
||||||
fields = append(fields, strings.Split(field, "."))
|
fields = append(fields, queryhelper.SafeSplit(field))
|
||||||
}
|
}
|
||||||
return fields
|
return fields
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user