@@ -516,6 +516,26 @@ func (ed *EndpointDetail) ensureRoute(
516516 return ctrlResult , nil
517517 }
518518
519+ // Check the route admission status and update condition accordingly
520+ err = checkRouteAdmissionStatus (ctx , helper , ed .Name , ed .Namespace )
521+ if err != nil {
522+ instance .Status .Conditions .Set (condition .FalseCondition (
523+ condType ,
524+ condition .ErrorReason ,
525+ condition .SeverityWarning ,
526+ corev1 .OpenStackControlPlaneExposeServiceReadyRouteAdmissionErrorMessage ,
527+ owner .GetName (),
528+ ed .Name ,
529+ err .Error ()))
530+ return ctrl.Result {}, err
531+ }
532+
533+ // Route is successfully created and admitted
534+ instance .Status .Conditions .MarkTrue (
535+ condType ,
536+ corev1 .OpenStackControlPlaneExposeServiceReadyMessage ,
537+ owner .GetName ())
538+
519539 return ctrl.Result {}, nil
520540 }
521541 instance .Status .Conditions .Remove (condType )
@@ -707,6 +727,45 @@ func (ed *EndpointDetail) CreateRoute(
707727 return ctrl.Result {}, nil
708728}
709729
730+ // checkRouteAdmissionStatus checks the admission status of a route and returns an error if not admitted
731+ func checkRouteAdmissionStatus (
732+ ctx context.Context ,
733+ helper * helper.Helper ,
734+ routeName string ,
735+ namespace string ,
736+ ) error {
737+ serviceRoute := & routev1.Route {}
738+ err := helper .GetClient ().Get (ctx , types.NamespacedName {Name : routeName , Namespace : namespace }, serviceRoute )
739+ if err != nil {
740+ return err
741+ }
742+
743+ // Check if the route has ingress status
744+ if len (serviceRoute .Status .Ingress ) == 0 {
745+ // Route exists but has no ingress status yet - this is normal during initial creation
746+ // Return nil to allow reconciliation to continue
747+ return nil
748+ }
749+
750+ // Check the admission status of the first ingress
751+ for _ , condition := range serviceRoute .Status .Ingress [0 ].Conditions {
752+ // RouteAdmitted (value: "Admitted") is currently the only officially defined condition type in the OpenShift Route API
753+ // https://github.com/openshift/api/blob/c9bef43e850983ce73f69a58b9da0bd02883c26a/route/v1/types.go#L384
754+ // RouteAdmitted means the route is able to service requests for the provided Host
755+ if condition .Type == routev1 .RouteAdmitted {
756+ if condition .Status != k8s_corev1 .ConditionTrue {
757+ // Route admission failed - return error with the message
758+ return fmt .Errorf ("%s" , condition .Message )
759+ }
760+ // Route is admitted successfully
761+ return nil
762+ }
763+ }
764+
765+ // No admission condition found yet - route is still being processed
766+ return nil
767+ }
768+
710769// GetEndptCertSecret -
711770func (e * Endpoints ) GetEndptCertSecret (endpt service.Endpoint ) * string {
712771 var endptTLSSecret * string
0 commit comments