1
0
mirror of https://github.com/rancher/steve.git synced 2025-05-10 00:47:07 +00:00

Add support for another field: ()

provisioning.cattle.io.clusters\
metadata.annotations[provisioning.cattle.io/management-cluster-display-name]

Needed to add another character to the subfieldRegex in
listoption_indexer to allow hyphens in annotation field names.
This commit is contained in:
Eric Promislow 2025-03-05 12:53:59 -08:00 committed by GitHub
parent 2f331b1a1a
commit f486902100
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 2 additions and 1 deletions
pkg
sqlcache/informer
stores/sqlproxy

View File

@ -41,7 +41,7 @@ type ListOptionIndexer struct {
var (
defaultIndexedFields = []string{"metadata.name", "metadata.creationTimestamp"}
defaultIndexNamespaced = "metadata.namespace"
subfieldRegex = regexp.MustCompile(`([a-zA-Z]+)|(\[[a-zA-Z./]+])|(\[[0-9]+])`)
subfieldRegex = regexp.MustCompile(`([a-zA-Z]+)|(\[[-a-zA-Z./]+])|(\[[0-9]+])`)
ErrInvalidColumn = errors.New("supplied column is invalid")
)

View File

@ -157,6 +157,7 @@ var (
{"spec", "ingressClassName"},
},
gvkKey("provisioning.cattle.io", "v1", "Cluster"): {
{"metadata", "annotations", "provisioning.cattle.io/management-cluster-display-name"},
{"metadata", "labels", "provider.cattle.io"},
{"status", "clusterName"},
{"status", "provider"},