File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed
internal/controller/indexer Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -24,6 +24,7 @@ const (
2424 IngressClassParametersRef = "ingressClassParametersRef"
2525 ConsumerGatewayRef = "consumerGatewayRef"
2626 PolicyTargetRefs = "targetRefs"
27+ GatewayClassIndexRef = "gatewayClassRef"
2728)
2829
2930func SetupIndexer (mgr ctrl.Manager ) error {
@@ -191,6 +192,17 @@ func setupGatewayProxyIndexer(mgr ctrl.Manager) error {
191192 return nil
192193}
193194
195+ func setupGatewayClassIndexer (mgr ctrl.Manager ) error {
196+ return mgr .GetFieldIndexer ().IndexField (
197+ context .Background (),
198+ & gatewayv1.Gateway {},
199+ GatewayClassIndexRef ,
200+ func (obj client.Object ) (requests []string ) {
201+ return []string {string (obj .(* gatewayv1.Gateway ).Spec .GatewayClassName )}
202+ },
203+ )
204+ }
205+
194206func GatewayProxySecretIndexFunc (rawObj client.Object ) []string {
195207 gatewayProxy := rawObj .(* v1alpha1.GatewayProxy )
196208 secretKeys := make ([]string , 0 )
You can’t perform that action at this time.
0 commit comments