There was a race between StopPodSandbox() between PodSandboxStatus(), Even when StopPodSandbox() successfully stopped the PodSandbox, PodSandboxStatus() could still return the state READY. It should be actually NOTREADY. That's so especially when a client calls PodSandboxStatus() too fast.
So just like done in RunPodSanbox(), StopPodSandbox() should also wait for a while, up to 10 seconds, until the correct state was set. For that, let's create a common helper waitPodSandboxStatus() which can be called by both Run and Stop.
Fixed another bug in this PR. Unlike StopPodSandbox, RunPodSandbox needs to take care of rktUUID instead of id. Otherwise PodSandbox doesn't run at all.
There was a race between
StopPodSandbox()
betweenPodSandboxStatus()
, Even whenStopPodSandbox()
successfully stopped the PodSandbox,PodSandboxStatus()
could still return the state READY. It should be actually NOTREADY. That's so especially when a client callsPodSandboxStatus()
too fast.So just like done in
RunPodSanbox()
,StopPodSandbox()
should also wait for a while, up to 10 seconds, until the correct state was set. For that, let's create a common helperwaitPodSandboxStatus()
which can be called by both Run and Stop.Fixes https://github.com/kubernetes-incubator/rktlet/issues/141