Minikube: `minikube docker-env --unset` requires minikube to be running

Created on 15 Jun 2020  路  7Comments  路  Source: kubernetes/minikube

Stopping minikube prevents the helper minikube docker-env --unset from working. Since the output of this command doesn't rely on minikube to be running, it doesn't seem like it should require minikube to be running (in fact, it of course makes a lot of sense to run it, if minikube is not running)


Steps to reproduce the issue:

$ minikube docker-env --unset
馃し  The control plane node must be running for this command
馃憠  To fix this, run: "minikube start"

Full output of minikube start command used, if not already included:
NA

$ minikube version
minikube version: v1.11.0
commit: 57e2f55f47effe9ce396cea42a1e0eb4f611ebbd
kinbug prioritimportant-longterm

Most helpful comment

For minikube docker-env and minikube podman-env, only set (the default) needs it to be running.

When using the --unset flag, it is supposed to work irregardless of the current machine status.

Basically shell detection need to be moved "higher", so that unset can use it (and exit)

And machine loading needs to be moved "lower", so that only set requires it (to run)

All 7 comments

/kind bug

This bug is specific to the minikube re-implementation, docker-machine does not have it.

顐奥燿ocker-machine stop
Stopping "default"...
Machine "default" was stopped.
顐奥燿ocker-machine env
Error checking TLS connection: Host is not running
顐奥燿ocker-machine env --unset
unset DOCKER_TLS_VERIFY
unset DOCKER_HOST
unset DOCKER_CERT_PATH
unset DOCKER_MACHINE_NAME
# Run this command to configure your shell: 
# eval $(docker-machine env --unset)

You can see how the set fails (understandable), but the unset still works - when stopped.

I would like to take this up.

Just for clarification, is unsetting the docker vars be independent of whether the docker-machine is running or not?
@afbjorklund

@Harkishen-Singh:
Oh, docker-machine doesn't have to be running - was just comparing the CLI output of the tools

For minikube docker-env and minikube podman-env, only set (the default) needs it to be running.

When using the --unset flag, it is supposed to work irregardless of the current machine status.

Basically shell detection need to be moved "higher", so that unset can use it (and exit)

And machine loading needs to be moved "lower", so that only set requires it (to run)

Sure @afbjorklund. Thanks for the additional information. In that case, I am making changes for the podman-env as well on the same PR.

Very nice! Thank you @Harkishen-Singh !

Was this page helpful?
0 / 5 - 0 ratings