mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-07 11:13:48 +00:00
commit
9b42f62da3
@ -321,23 +321,3 @@ func getPodStatus(pod *api.Pod, minions client.MinionInterface) (api.PodStatus,
|
|||||||
return api.PodWaiting, nil
|
return api.PodWaiting, nil
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (rs *REST) waitForPodRunning(ctx api.Context, pod *api.Pod) (runtime.Object, error) {
|
|
||||||
for {
|
|
||||||
podObj, err := rs.Get(ctx, pod.ID)
|
|
||||||
if err != nil || podObj == nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
podPtr, ok := podObj.(*api.Pod)
|
|
||||||
if !ok {
|
|
||||||
// This should really never happen.
|
|
||||||
return nil, fmt.Errorf("Error %#v is not an api.Pod!", podObj)
|
|
||||||
}
|
|
||||||
switch podPtr.CurrentState.Status {
|
|
||||||
case api.PodRunning, api.PodTerminated:
|
|
||||||
return pod, nil
|
|
||||||
default:
|
|
||||||
time.Sleep(rs.podPollPeriod)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
Loading…
Reference in New Issue
Block a user