@@ -185,9 +185,31 @@ func (r *ReconcilerBase) isKnativeReady(ba common.BaseComponent, c common.Status
185185
186186 msg , reason := "" , ""
187187
188- // Check if knative service exists
188+ // Check if the Knative Service exists
189189 if err := r .GetClient ().Get (context .TODO (), namespacedName , knative ); err != nil {
190- msg , reason = "Knative service is not ready." , "NotCreated"
190+ msg , reason = "Knative Service is not ready." , "ServiceNotCreated"
191+ return c .SetConditionFields (msg , reason , corev1 .ConditionFalse )
192+ }
193+
194+ // Check the Knative Service's status
195+ knativeReadyStatusFound := false
196+ for _ , condition := range knative .Status .Conditions {
197+ if condition .Type == "Ready" {
198+ knativeReadyStatusFound = true
199+ if condition .Status != "True" {
200+ msg , reason = "Knative Service is not ready." , "ServiceNotReady"
201+ if len (condition .Message ) > 0 {
202+ msg = "Knative Service is not ready; " + condition .Message
203+ }
204+ if len (condition .Reason ) > 0 {
205+ reason = condition .Reason
206+ }
207+ return c .SetConditionFields (msg , reason , corev1 .ConditionFalse )
208+ }
209+ }
210+ }
211+ if ! knativeReadyStatusFound {
212+ msg , reason = "Knative Service is not ready; Waiting for the Service's status to appear." , "ServiceStatusNotFound"
191213 return c .SetConditionFields (msg , reason , corev1 .ConditionFalse )
192214 }
193215
0 commit comments