Skip to content

minikube status exits with 0 when there is no minikube container #22466

@Enteee

Description

@Enteee

What Happened?

Running minikube status on a system without a minikube container we get the following error:

$ minikube status
E0116 14:50:53.995077 3483121 status.go:179] status error: host: state: unknown state "minikube": docker container inspect minikube --format={{.State.Status}}: exit status 1
stdout:


stderr:
Error response from daemon: No such container: minikube
E0116 14:50:53.995092 3483121 status.go:126] status error: host: state: unknown state "minikube": docker container inspect minikube --format={{.State.Status}}: exit status 1
stdout:


stderr:
Error response from daemon: No such container: minikub

... and what's really bad is that this exits with 0 (success). This used to work find with earlier versions of minikube.

The impact of this is that it causes major issues in my pipelines as I use if minikube status &>/dev/null; then ... fi; to detect if the user already has a minikube cluster running.

reproduce

  1. minikube stop
  2. docker system prune -a
  3. minikube status; echo $?

minikube version

$ minikube version
minikube version: v1.37.0
commit: v1.37.0

Attach the log file

$ minikube status
E0116 14:50:53.995077 3483121 status.go:179] status error: host: state: unknown state "minikube": docker container inspect minikube --format={{.State.Status}}: exit status 1
stdout:


stderr:
Error response from daemon: No such container: minikube
E0116 14:50:53.995092 3483121 status.go:126] status error: host: state: unknown state "minikube": docker container inspect minikube --format={{.State.Status}}: exit status 1
stdout:


stderr:
Error response from daemon: No such container: minikub

Operating System

Redhat/Fedora

Driver

Docker

Metadata

Metadata

Assignees

No one assigned

    Labels

    help wantedDenotes an issue that needs help from a contributor. Must meet "help wanted" guidelines.kind/bugCategorizes issue or PR as related to a bug.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions