@@ -411,29 +411,6 @@ func (t *Translator) ProcessListeners(gateways []*GatewayContext, xdsIR resource
411411 t .checkOverlappingTLSConfig (gateways )
412412}
413413
414- // isListenerReady returns true if the listener is ready (Accepted=True and Programmed=True or no conditions yet).
415- // A listener is not ready if it has Accepted=False or Programmed=False.
416- func isListenerReady (listener * ListenerContext ) bool {
417- conditions := listener .GetConditions ()
418-
419- // No conditions yet means it will be set to ready during validation.
420- if len (conditions ) == 0 {
421- return true
422- }
423-
424- // Check if Accepted=False or Programmed=False exists.
425- for _ , cond := range conditions {
426- if cond .Type == string (gwapiv1 .ListenerConditionAccepted ) && cond .Status == metav1 .ConditionFalse {
427- return false
428- }
429- if cond .Type == string (gwapiv1 .ListenerConditionProgrammed ) && cond .Status == metav1 .ConditionFalse {
430- return false
431- }
432- }
433-
434- return true
435- }
436-
437414// checkOverlappingTLSConfig checks for overlapping hostnames and certificates between listeners and sets
438415// the `OverlappingTLSConfig` condition if there are overlapping hostnames or certificates.
439416func (t * Translator ) checkOverlappingTLSConfig (gateways []* GatewayContext ) {
@@ -442,7 +419,7 @@ func (t *Translator) checkOverlappingTLSConfig(gateways []*GatewayContext) {
442419 httpsListeners := []* ListenerContext {}
443420 for _ , gateway := range gateways {
444421 for _ , listener := range gateway .listeners {
445- if listener .Protocol == gwapiv1 .HTTPSProtocolType && isListenerReady ( listener ) {
422+ if listener .Protocol == gwapiv1 .HTTPSProtocolType && listener . IsReady ( ) {
446423 httpsListeners = append (httpsListeners , listener )
447424 }
448425 }
@@ -457,7 +434,7 @@ func (t *Translator) checkOverlappingTLSConfig(gateways []*GatewayContext) {
457434 for _ , gateway := range gateways {
458435 httpsListeners := []* ListenerContext {}
459436 for _ , listener := range gateway .listeners {
460- if listener .Protocol == gwapiv1 .HTTPSProtocolType && isListenerReady ( listener ) {
437+ if listener .Protocol == gwapiv1 .HTTPSProtocolType && listener . IsReady ( ) {
461438 httpsListeners = append (httpsListeners , listener )
462439 }
463440 }
0 commit comments