Skip to content

Commit

Permalink
devdb: check readlyness with container status
Browse files Browse the repository at this point in the history
  • Loading branch information
giautm committed Nov 14, 2024
1 parent ff716bd commit f07bfc8
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions internal/controller/devdb.go
Original file line number Diff line number Diff line change
Expand Up @@ -395,6 +395,11 @@ func readyPod(pods []corev1.Pod) (*corev1.Pod, error) {
return nil, errors.New("no pods found")
}
idx := slices.IndexFunc(pods, func(p corev1.Pod) bool {
for _, c := range p.Status.ContainerStatuses {
if !c.Ready {
return false
}
}
return slices.ContainsFunc(p.Status.Conditions, func(c corev1.PodCondition) bool {
return c.Type == corev1.PodReady && c.Status == corev1.ConditionTrue
})
Expand Down

0 comments on commit f07bfc8

Please sign in to comment.