when trying to fix this issue https://github.com/kubernetes/minikube/pull/19576
that docker desktop Hangs on listing containers... I didnt get any warnninig from minikube that docker is slow and minikube hanged....
(only with a docker desktop Docker Desktop 4.34.0 with macos)
I remembered that we had a logic that was supposed to Warn users but apparantly that logic doesnt work
here is the code that lists the containers in oci.go
// ListContainersByLabel returns all the container names with a specified label
func ListContainersByLabel(ctx context.Context, ociBin string, label string, warnSlow ...bool) ([]string, error) {
rr, err := runCmd(exec.CommandContext(ctx, ociBin, "ps", "-a", "--filter", fmt.Sprintf("label=%s", label), "--format", "{{.Names}}"), warnSlow...)
if err != nil {
return nil, err
}
s := bufio.NewScanner(bytes.NewReader(rr.Stdout.Bytes()))
var names []string
for s.Scan() {
n := strings.TrimSpace(s.Text())
if n != "" {
names = append(names, n)
}
}
return names, s.Err()
and also here is the runCmd logic that was supposed to Warn users that the docker or podman is returning slow
the logic is in cli_runner.go
// runCmd runs a command exec.Command against docker daemon or podman
func runCmd(cmd *exec.Cmd, warnSlow ...bool) (*RunResult, error) {
cmd = PrefixCmd(cmd)
warn := false
if len(warnSlow) > 0 {
warn = warnSlow[0]
}
killTime := 19 * time.Second // this will be applied only if warnSlow is true
warnTime := 2 * time.Second
we need to fix this code so it can be triggered the slowness of docker or podman. it really hurts user experience when they try to delete minikube and it just hangs ...without any info
to mock this , you can make a dummy "docker" binary in your path that Waits 10 minutes(to emulate a slow docker)
when trying to fix this issue https://github.com/kubernetes/minikube/pull/19576 that docker desktop Hangs on listing containers... I didnt get any warnninig from minikube that docker is slow and minikube hanged....
(only with a docker desktop Docker Desktop 4.34.0 with macos)
I remembered that we had a logic that was supposed to Warn users but apparantly that logic doesnt work here is the code that lists the containers in oci.go
and also here is the runCmd logic that was supposed to Warn users that the docker or podman is returning slow
the logic is in cli_runner.go
we need to fix this code so it can be triggered the slowness of docker or podman. it really hurts user experience when they try to delete minikube and it just hangs ...without any info
to mock this , you can make a dummy "docker" binary in your path that Waits 10 minutes(to emulate a slow docker)