File tree Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -29,6 +29,7 @@ import (
2929 "github.com/pkg/errors"
3030 "k8s.io/minikube/pkg/minikube/constants"
3131 "k8s.io/minikube/pkg/minikube/localpath"
32+ "k8s.io/minikube/pkg/util/retry"
3233
3334 "fmt"
3435 "os/exec"
@@ -164,6 +165,23 @@ func CreateContainerNode(p CreateParams) error {
164165 if err != nil {
165166 return errors .Wrap (err , "create a kic node" )
166167 }
168+
169+ checkRunning := func () error {
170+ s , err := ContainerStatus (p .OCIBinary , p .Name )
171+ if err != nil {
172+ return fmt .Errorf ("temporary error checking status for %q : %v" , p .Name , err )
173+ }
174+ if s != "running" {
175+ return fmt .Errorf ("temporary error created container %q is not running yet" , p .Name )
176+ }
177+ return nil
178+ }
179+
180+ // retry up to up 5 seconds to make sure the created container status is running.
181+ if err = retry .Expo (checkRunning , 13 * time .Millisecond , time .Second * 5 ); err != nil {
182+ glog .Warningf ("The created container %q failed to report to be running in 5 seconds." , p .Name )
183+ }
184+
167185 return nil
168186}
169187
You can’t perform that action at this time.
0 commit comments