提交 90368617 编写于 作者: P Priya Wadhwa

Check for iptables file before determining container is running

上级 0b53e905
......@@ -212,6 +212,9 @@ func CreateContainerNode(p CreateParams) error {
if s != state.Running {
return fmt.Errorf("temporary error created container %q is not running yet", p.Name)
}
if !iptablesFileExists(p.OCIBinary, p.Name) {
return fmt.Errorf("iptables file doesn't exist, see #8179")
}
glog.Infof("the created container %q has a running status.", p.Name)
return nil
}
......@@ -576,3 +579,19 @@ func ShutDown(ociBin string, name string) error {
glog.Infof("Successfully shutdown container %s", name)
return nil
}
// iptablesFileExists checks if /var/lib/dpkg/alternatives/iptables exists in minikube
// this file is necessary for the entrypoint script to pass
// see: https://github.com/kubernetes/minikube/issues/8179
func iptablesFileExists(ociBin string, nameOrID string) bool {
if ociBin != Docker {
return true
}
file := "/var/lib/dpkg/alternatives/iptables"
_, err := runCmd(exec.Command(ociBin, "exec", nameOrID, "stat", file), false)
if err != nil {
glog.Warningf("error checking if %s exists: %v", file, err)
return false
}
return true
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册