mirror of
https://gitee.com/rainbond/Rainbond.git
synced 2024-11-30 10:48:15 +08:00
change pod status judgment logic
This commit is contained in:
parent
b1b16141a4
commit
8d77483d79
@ -72,16 +72,18 @@ func DescribePodStatus(clientset kubernetes.Interface, pod *corev1.Pod, podStatu
|
||||
if podStatus.Type == pb.PodStatus_INITIATING {
|
||||
podStatus.Advice = PodStatusAdviceInitiating.String()
|
||||
// if all main container ready
|
||||
allMainCReady := true
|
||||
for _, mainC := range pod.Status.ContainerStatuses {
|
||||
if !mainC.Ready {
|
||||
allMainCReady = false
|
||||
break
|
||||
if len(pod.Status.ContainerStatuses) > 0 {
|
||||
allMainCReady := true
|
||||
for _, mainC := range pod.Status.ContainerStatuses {
|
||||
if !mainC.Ready {
|
||||
allMainCReady = false
|
||||
break
|
||||
}
|
||||
}
|
||||
if allMainCReady {
|
||||
podStatus.Type = pb.PodStatus_RUNNING
|
||||
return
|
||||
}
|
||||
}
|
||||
if allMainCReady {
|
||||
podStatus.Type = pb.PodStatus_RUNNING
|
||||
return
|
||||
}
|
||||
return
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user