Skip to content
This repository has been archived by the owner on Sep 26, 2021. It is now read-only.

"active" and "ls" use different checks for active machine #1651

Closed
ilkka opened this issue Aug 6, 2015 · 3 comments · Fixed by #1656
Closed

"active" and "ls" use different checks for active machine #1651

ilkka opened this issue Aug 6, 2015 · 3 comments · Fixed by #1656

Comments

@ilkka
Copy link

ilkka commented Aug 6, 2015

Just noticed when commenting on brikis98/docker-osx-dev#77 that the "active" and "ls" commands use different methods for determining if a machine is active or not. Don't know if this is intentional, but for "active" using Filestore, only the value of DOCKER_HOST is checked against the host's URL. For "ls", attemptGetHostState in libmachine/host checks both the URL and also that the machine is not in state "Stopped". When DOCKER_HOST is set but e.g. the VM it points to is stopped, the commands now report slightly confusing results.

@nathanleclaire
Copy link
Contributor

Good catch. They should definitely use the same, shared method.

@mattjmcnaughton
Copy link
Contributor

👍

I'd love to call #dibs on this if that's cool (idk if machine uses #dibs like docker) - been looking to get involved with this project for a while and this seems like a good first issue.

@nathanleclaire
Copy link
Contributor

If you're interested, go for it @mattjmcnaughton ! I've been treating the "help-wanted" tag as kind of a "Hey, these issues are relatively non-controversial and might be worth looking into for someone wanting to contribute to Machine".

afbjorklund pushed a commit to minikube-machine/machine that referenced this issue Jun 10, 2023
Fix docker/machine#1651

As pointed out in the issue above, the `active` and `ls` commands used
different methods for determing the active machine. This commit defines
a single method on the `host` struct called `IsActive` which provides
a uniform check for machine activness. `IsActive` returns true only
if `DOCKER_HOST == url` and the state is not stopped - previously the
`active` command only checked the url.

* Add a single `host` method `IsActive` for determining if a machine is
  active.

Signed-off-by: Matt McNaughton <[email protected]>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants