Skip to content

Commit

Permalink
fix(ctrl): monitor Pod ready condition
Browse files Browse the repository at this point in the history
When the user uses a startup probe, the Integration won't turn as running until the condition is reached

Closes apache#4977
  • Loading branch information
squakez committed Jan 4, 2024
1 parent 75596a5 commit d5e441b
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion pkg/controller/integration/monitor.go
Original file line number Diff line number Diff line change
Expand Up @@ -332,8 +332,8 @@ func (action *monitorAction) updateIntegrationPhaseAndReadyCondition(
if done := checkPodStatuses(integration, pendingPods, runningPods); done {
return nil
}
integration.Status.Phase = v1.IntegrationPhaseRunning

integration.Status.Phase = v1.IntegrationPhaseRunning
if done := controller.updateReadyCondition(readyPods); done {
return nil
}
Expand Down Expand Up @@ -390,6 +390,13 @@ func checkPodStatuses(integration *v1.Integration, pendingPods []corev1.Pod, run
integration.SetReadyConditionError(terminated.Message)
return true
}
// Check Ready condition (may be used with a startup probe)
if ready := kubernetes.GetPodCondition(pod, corev1.PodReady); ready != nil &&
ready.Status == corev1.ConditionFalse {
integration.Status.Phase = v1.IntegrationPhaseError
integration.SetReadyConditionError(ready.Message)
return true
}
}
}

Expand Down

0 comments on commit d5e441b

Please sign in to comment.