@@ -120,6 +120,8 @@ func (r *GatewayReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ct
120120 Secrets : make (map [types.NamespacedName ]* corev1.Secret ),
121121 }
122122 r .processListenerConfig (tctx , gateway , ns )
123+ r .processGatewayProxy (tctx , gateway , ns )
124+
123125 if err := r .Provider .Update (ctx , tctx , gateway ); err != nil {
124126 acceptStatus = status {
125127 status : false ,
@@ -265,6 +267,25 @@ func (r *GatewayReconciler) listGatewaysForHTTPRoute(_ context.Context, obj clie
265267 return recs
266268}
267269
270+ func (r * GatewayReconciler ) processGatewayProxy (tctx * provider.TranslateContext , gateway * gatewayv1.Gateway , ns string ) {
271+ infra := gateway .Spec .Infrastructure
272+ if infra != nil && infra .ParametersRef != nil {
273+ paramRef := infra .ParametersRef
274+ if string (paramRef .Group ) == v1alpha1 .GroupVersion .Group && string (paramRef .Kind ) == "GatewayProxy" {
275+ gatewayProxy := & v1alpha1.GatewayProxy {}
276+ if err := r .Get (context .Background (), client.ObjectKey {
277+ Namespace : ns ,
278+ Name : string (paramRef .Name ),
279+ }, gatewayProxy ); err != nil {
280+ log .Error (err , "failed to get GatewayProxy" , "namespace" , ns , "name" , string (paramRef .Name ))
281+ } else {
282+ log .Info ("found GatewayProxy for Gateway" , "gateway" , gateway .Name , "gatewayproxy" , gatewayProxy .Name )
283+ tctx .GatewayProxy = gatewayProxy
284+ }
285+ }
286+ }
287+ }
288+
268289func (r * GatewayReconciler ) processListenerConfig (tctx * provider.TranslateContext , gateway * gatewayv1.Gateway , ns string ) {
269290 listeners := gateway .Spec .Listeners
270291 for _ , listener := range listeners {
0 commit comments