1
0
mirror of https://github.com/rancher/steve.git synced 2025-04-28 03:10:32 +00:00

Ensure complex accessors from schema don't result in double-bracketing. (#531)

This commit is contained in:
Eric Promislow 2025-03-04 09:52:35 -08:00 committed by GitHub
parent 2711fd1f46
commit 2f331b1a1a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -15,6 +15,7 @@ import (
"sync"
"github.com/pkg/errors"
"github.com/rancher/steve/pkg/stores/queryhelper"
"github.com/sirupsen/logrus"
"golang.org/x/sync/errgroup"
"k8s.io/apimachinery/pkg/api/meta"
@ -371,7 +372,7 @@ func getFieldsFromSchema(schema *types.APISchema) [][]string {
}
for _, colDef := range colDefs {
field := strings.TrimPrefix(colDef.Field, "$.")
fields = append(fields, strings.Split(field, "."))
fields = append(fields, queryhelper.SafeSplit(field))
}
return fields
}