From f48690210021f1d5be996593caea9a6e476e8d46 Mon Sep 17 00:00:00 2001 From: Eric Promislow Date: Wed, 5 Mar 2025 12:53:59 -0800 Subject: [PATCH] Add support for another field: (#532) 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. --- pkg/sqlcache/informer/listoption_indexer.go | 2 +- pkg/stores/sqlproxy/proxy_store.go | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/pkg/sqlcache/informer/listoption_indexer.go b/pkg/sqlcache/informer/listoption_indexer.go index bff6583e..b0c57547 100644 --- a/pkg/sqlcache/informer/listoption_indexer.go +++ b/pkg/sqlcache/informer/listoption_indexer.go @@ -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") ) diff --git a/pkg/stores/sqlproxy/proxy_store.go b/pkg/stores/sqlproxy/proxy_store.go index b7a78abb..96e03986 100644 --- a/pkg/stores/sqlproxy/proxy_store.go +++ b/pkg/stores/sqlproxy/proxy_store.go @@ -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"},