mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-10 12:32:03 +00:00
resolve pod readiness issue
see https://github.com/mesosphere/kubernetes-mesos/issues/342 xref #9710
This commit is contained in:
parent
5e5c1d1097
commit
c0b686e3be
@ -490,7 +490,18 @@ func (k *KubernetesExecutor) launchTask(driver bindings.ExecutorDriver, taskId s
|
|||||||
|
|
||||||
// Delay reporting 'task running' until container is up.
|
// Delay reporting 'task running' until container is up.
|
||||||
psf := podStatusFunc(func() (*api.PodStatus, error) {
|
psf := podStatusFunc(func() (*api.PodStatus, error) {
|
||||||
return k.podStatusFunc(k.kl, pod)
|
status, err := k.podStatusFunc(k.kl, pod)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
status.Phase = kubelet.GetPhase(&pod.Spec, status.ContainerStatuses)
|
||||||
|
hostIP, err := k.kl.GetHostIP()
|
||||||
|
if err != nil {
|
||||||
|
log.Errorf("Cannot get host IP: %v", err)
|
||||||
|
} else {
|
||||||
|
status.HostIP = hostIP.String()
|
||||||
|
}
|
||||||
|
return status, nil
|
||||||
})
|
})
|
||||||
|
|
||||||
go k._launchTask(driver, taskId, podFullName, psf)
|
go k._launchTask(driver, taskId, podFullName, psf)
|
||||||
|
Loading…
Reference in New Issue
Block a user