@@ -292,8 +292,10 @@ func (t *Translator) GetRelevantGateways(resources *resource.Resources) (
292
292
) {
293
293
envoyproxyMap := make (map [types.NamespacedName ]* egv1a1.EnvoyProxy , len (resources .EnvoyProxiesForGateways )+ 1 )
294
294
envoyproxyValidationErrorMap := make (map [types.NamespacedName ]error , len (resources .EnvoyProxiesForGateways ))
295
- // make sure that the EnvoyProxyForGatewayClass is valid
296
- // TODO: how to handle EnvoyProxy for GatewayClass not found?
295
+
296
+ // if EnvoyProxy not found, provider layer set GC status to not accepted.
297
+ // if EnvoyProxy found but invalid, set GC status to not accepted,
298
+ // otherwise set GC status to accepted.
297
299
if ep := resources .EnvoyProxyForGatewayClass ; ep != nil {
298
300
err := validateEnvoyProxy (ep )
299
301
if err != nil {
@@ -305,11 +307,14 @@ func (t *Translator) GetRelevantGateways(resources *resource.Resources) (
305
307
fmt .Sprintf ("%s: %v" , status .MsgGatewayClassInvalidParams , err ))
306
308
return
307
309
} else {
308
- status .SetGatewayClassAccepted (
309
- resources .GatewayClass ,
310
- true ,
311
- string (gwapiv1 .GatewayClassReasonAccepted ),
312
- status .MsgValidGatewayClass )
310
+ // TODO: remove this nil check after we update all the testdata.
311
+ if resources .GatewayClass != nil {
312
+ status .SetGatewayClassAccepted (
313
+ resources .GatewayClass ,
314
+ true ,
315
+ string (gwapiv1 .GatewayClassReasonAccepted ),
316
+ status .MsgValidGatewayClass )
317
+ }
313
318
}
314
319
315
320
key := utils .NamespacedName (ep )
0 commit comments