Commit Graph

124 Commits

Author SHA1 Message Date
Roman Coedo f81870e4f1 Global set for fish env
Using "set -x" only exports the variable in the local scope.
This is a limitation when an user needs to invoke "docker-machine" in a fish script.

Using "set -gx" instead exports the variable globally.

Signed-off-by: Roman Coedo <romancoedo@gmail.com>
2015-11-18 21:35:32 +01:00
David Gageot fa24554871 Merge pull request #2290 from dgageot/quality-03-simpler-test
Quality 03 simpler test
2015-11-18 09:40:25 +01:00
David Gageot 0c296783be Merge pull request #2289 from dgageot/quality-02-move-code
Quality 02 move code
2015-11-18 09:40:01 +01:00
Nick Gauthier a34a394810 skip printing swarm info when host options swarm info is nil
Fixes #2252 #2280

Signed-off-by: Nick Gauthier <ngauthier@gmail.com>
2015-11-16 15:54:16 +01:00
David Gageot a8e3ee868f Simpler test code
Signed-off-by: David Gageot <david@gageot.net>
2015-11-13 16:27:50 +01:00
David Gageot eb39f098d5 Move code where it's used
Signed-off-by: David Gageot <david@gageot.net>
2015-11-13 16:27:50 +01:00
David Gageot 8bbfc6ef2a Remove unused code
Signed-off-by: David Gageot <david@gageot.net>
2015-11-13 16:27:50 +01:00
Jean-Laurent de Morlhon fe37f1fb0d Fix #2204 broken env unset
Signed-off-by: Jean-Laurent de Morlhon <jeanlaurent@morlhon.net>
2015-11-12 17:32:27 +01:00
Olivier Gambier 89d9854943 Another pass at linting
Signed-off-by: Olivier Gambier <olivier@docker.com>
2015-11-10 16:58:14 +01:00
David Gageot 68092b3524 FIX #2154 query virtualbox serially
Signed-off-by: David Gageot <david@gageot.net>
Signed-off-by: Nathan LeClaire <nathan.leclaire@gmail.com>
2015-11-07 16:14:25 +01:00
Olivier Gambier d2ada6488c Lint
Signed-off-by: Olivier Gambier <olivier@docker.com>
2015-11-05 13:34:07 -08:00
David Gageot 99d6fe134d Introduce CommandLine interface
Signed-off-by: David Gageot <david@gageot.net>
2015-11-05 06:07:57 +01:00
Olivier Gambier 19fc49b58a Lint, step 1
The easy stuff

Signed-off-by: Olivier Gambier <olivier@docker.com>
2015-11-04 14:17:58 -08:00
David Gageot 8a452a9629 FIX #2064 Support local windows path
+ Use assert in tests
+ Improve parsing
+ Simplify code and tests

Signed-off-by: David Gageot <david@gageot.net>
2015-11-04 09:48:21 +01:00
Nathan LeClaire 9a4bc9a20d Ensure that ls will still work when plugin cannot be found
Signed-off-by: Nathan LeClaire <nathan.leclaire@gmail.com>
2015-11-03 11:35:30 -08:00
Nathan LeClaire bccbe19a86 Merge pull request #2146 from nathanleclaire/rm_automatic_cert_regeneration
Remove automatic certificate regeneration
2015-11-02 22:14:22 -08:00
Nathan LeClaire f5b6c87e7c Remove automatic certificate regeneration
Signed-off-by: Nathan LeClaire <nathan.leclaire@gmail.com>
2015-11-02 19:31:29 -08:00
Nathan LeClaire 060f0a0db2 Fix issues with create and ssh command help text
Signed-off-by: Nathan LeClaire <nathan.leclaire@gmail.com>
2015-10-30 16:21:47 -07:00
David Gageot 86c52ec3e7 Make commands code easier to test
Signed-off-by: David Gageot <david@gageot.net>
2015-10-29 11:15:17 +01:00
Nathan LeClaire c04eb43021 Remove redundant error log
Signed-off-by: Nathan LeClaire <nathan.leclaire@gmail.com>
2015-10-28 13:56:29 -07:00
Nathan LeClaire 9f01770d7e Merge pull request #2084 from dgageot/simpler-env-hints
Simpler code for env usage hints.
2015-10-27 11:59:51 -07:00
Nathan LeClaire 9fa2f73139 Merge pull request #2032 from hairyhenderson/make-active-work-with-swarm-1311
Returning active host when swarm is active
2015-10-26 12:54:44 -07:00
David Gageot 2d1e6d0163 Simpler code for env usage hints.
We can just output the original os.Args in the
eval call.

Signed-off-by: David Gageot <david@gageot.net>
2015-10-26 10:31:18 +01:00
David Gageot ab1b0ca2e9 Remove dead code
Signed-off-by: David Gageot <david@gageot.net>
2015-10-26 09:35:12 +01:00
Dave Henderson ee4a357441 Returning active host when swarm is active
Signed-off-by: Dave Henderson <dhenderson@gmail.com>
2015-10-24 12:47:49 -04:00
Nathan LeClaire b038ff4020 Fixes https://github.com/docker/machine/issues/2062
Signed-off-by: Nathan LeClaire <nathan.leclaire@gmail.com>
2015-10-23 13:58:32 -07:00
Olivier Gambier 4bd43d604f Merge pull request #2053 from nathanleclaire/rpc_heartbeat
Add heartbeat / automatic server cleanup code
2015-10-23 10:40:45 -07:00
Nathan LeClaire 76c7accda0 Add heartbeat / automatic server cleanup code
This replaces the previous method of attempting to clean up servers when
an unexpected exit occurs in the client (e.g. SIGINT or panic) by a
heartbeat protocol.  If the server does not hear from the connecting
client within a certain interval of time (500ms in this commit), it will
de-activate itself.  This prevents dangling Docker Machine server
processes from accumulating.

Signed-off-by: Nathan LeClaire <nathan.leclaire@gmail.com>
2015-10-22 19:44:35 -07:00
Nathan LeClaire 07bcb9a7aa Merge pull request #2058 from dgageot/improve-cmd-exe-support
improve cmd shell support
2015-10-22 11:59:55 -07:00
Stefan Scherer 1d3268d128 improve cmd shell support
Signed-off-by: Stefan Scherer <scherer_stefan@icloud.com>

Signed-off-by: David Gageot <david@gageot.net>
2015-10-22 12:15:33 +02:00
David Gageot e2b6a832ac Add more debug during certificates validation
Signed-off-by: David Gageot <david@gageot.net>
2015-10-22 11:11:31 +02:00
Nathan LeClaire cb473ad0a7 Merge pull request #2027 from dgageot/2019-fix-env-hints
FIX #2019 invalid env hints
2015-10-21 16:44:33 -07:00
David Gageot 6bbec2df68 Report VirtualBox errors
Signed-off-by: David Gageot <david@gageot.net>
2015-10-21 21:03:51 +02:00
David Gageot bd532747f1 FIX #2019 invalid env hints
Signed-off-by: David Gageot <david@gageot.net>
2015-10-20 17:58:35 +02:00
Nathan LeClaire 56f457c2ef Merge pull request #2013 from nathanleclaire/no_stdout_env_config
Ensure log writes only to os.Stderr for env and config command
2015-10-19 17:43:23 -07:00
Nathan LeClaire 17f0a32b79 Ensure log writes only to os.Stderr for env and config command
Signed-off-by: Nathan LeClaire <nathan.leclaire@gmail.com>
2015-10-19 17:30:18 -07:00
Dave Henderson 486e359e63 Fixing JSON marshaling of large numbers during migration
- Added some context to an error message - it's useful to know _which_
  plugin failed when invoking the binary failed
- Replaced `json.Umarshal` with a `json.Decoder`, so that the
  `UseNumber` function can be called, which prevents large integers from
  being interpreted as `float64`s.
- Fixed a couple `log.Warn` calls that should've been `log.Warnf`

Signed-off-by: Dave Henderson <dhenderson@gmail.com>
2015-10-19 18:00:19 -04:00
Nathan LeClaire c8edb33ecd Move towards using external binaries / RPC plugins
- First RPC steps

- Work on some flaws in RPC model

- Remove unused TLS settings from Engine and Swarm options

- Add code to correctly encode data over the network

- Add client driver for RPC

- Rename server driver file

- Start to make marshal make sense

- Fix silly RPC method args and add client

- Fix some issues with RPC calls, and marshaling

- Simplify plugin main.go

- Move towards 100% plugin in CLI

- Ensure that plugin servers are cleaned up properly

- Make flag parsing for driver flags work properly

Includes some work carried from @dmp42 updating the build process and
tests to use the new method.

Signed-off-by: Nathan LeClaire <nathan.leclaire@gmail.com>
2015-10-16 16:34:56 -07:00
Olivier Gambier 53ace516a4 Merge pull request #1960 from dgageot/1914-create-ignores-trailing-options
FIX #1914 Reject command lines with trailing flags
2015-10-14 10:28:38 -07:00
Nathan LeClaire 998ada5303 Fix Windows SSH issues
Signed-off-by: Nathan LeClaire <nathan.leclaire@gmail.com>
2015-10-13 16:42:08 -07:00
David Gageot cd80b70d26 FIX #1914 Reject command lines with trailing flags
Signed-off-by: David Gageot <david@gageot.net>
2015-10-13 16:29:28 +02:00
Nathan LeClaire 571712122d Merge pull request #1909 from skatsuta/saved-host-active
Change 'ls' to not report 'Saved' hosts as active when $DOCKER_HOST is not set
2015-10-08 11:00:45 -07:00
Soshi Katsuta 5af32bcdd3 commands: make `ls` to not report saved hosts to be active when $DOCKER_HOST is not set
Signed-off-by: Soshi Katsuta <soshi.katsuta@gmail.com>
2015-10-09 00:59:33 +09:00
Nathan LeClaire 94c551b964 Fix broken --storage-path flag
Signed-off-by: Nathan LeClaire <nathan.leclaire@gmail.com>
2015-10-07 13:31:00 -07:00
Nathan LeClaire bd03e83239 Merge pull request #1873 from djimenez/detectShellWindows
Issue #1867 improve detectShell for windows
2015-10-05 13:32:53 -07:00
Kazuyuki SUZUKI 2bc53a6ac3 Add argument assertion to inspect/status/url commands
Signed-off-by: Kazuyuki Suzuki <kechol28@gmail.com>
2015-10-01 14:15:29 +09:00
Alexey Grachov b970dddc8b Remove dead code.
Function getMachineDir is not used.

Signed-off-by: Alexey Grachov <grachov.alexey@gmail.com>
2015-09-29 20:30:20 +03:00
Nathan LeClaire 0a2b9c2784 Fix flag accidentally left out in PR carry
Signed-off-by: Nathan LeClaire <nathan.leclaire@gmail.com>
2015-09-23 17:57:52 -07:00
Fabian Ruff d22a4118d0 --no-proxy flag for env command
This optinal flag will add the docker host to the no_proxy environement variable. This is useful for local providers (e.g. virtualbox, fusion) in environments where an http_proxy is set and docker by default tries to connect to the ip via the proxy.

Signed-off-by: Fabian Ruff <fabian@progra.de>
2015-09-23 14:48:01 -07:00
Nathan LeClaire b5927f10c4 Make libmachine usable by outside world
- Clear out some cruft tightly coupling libmachine to filestore

- Comment out drivers other than virtualbox for now

- Change way too many things

- Mostly, break out the code to be more modular.

- Destroy all traces of "provider" in its current form.  It will be
brought back as something more sensible, instead of something which
overlaps in function with both Host and Store.

- Fix mis-managed config passthru

- Remove a few instances of state stored in env vars

- This should be explicitly communicated in Go-land, not through the
shell.

- Rename "store" module to "persist"

- This is done mostly to avoid confusion about the fact that a concrete
instance of a "Store" interface is oftentimes referred to as "store" in
the code.

- Rip out repetitive antipattern for getting store

- This replaces the previous repetive idiom for getting the cert info, and
consequently the store, with a much less repetitive idiom.

- Also, some redundant methods in commands.go for accessing hosts have
either been simplified or removed entirely.

- First steps towards fixing up tests

- Test progress continues

- Replace unit tests with integration tests

- MAKE ALL UNIT TESTS PASS YAY

- Add helper test files

- Don't write to disk in libmachine/host

- Heh.. coverage check strikes again

- Fix remove code

- Move cert code around

- Continued progress: simplify Driver

- Fixups and make creation work with new model

- Move drivers module inside of libmachine

- Move ssh module inside of libmachine

- Move state module to libmachine

- Move utils module to libmachine

- Move version module to libmachine

- Move log module to libmachine

- Modify some constructor methods around

- Change Travis build dep structure

- Boring gofmt fix

- Add version module

- Move NewHost to store

- Update some boring cert path infos to make API easier to use

- Fix up some issues around the new model

- Clean up some cert path stuff

- Don't use shady functions to get store path :D

- Continue artifact work

- Fix silly machines dir bug

- Continue fixing silly path issues

- Change up output of vbm a bit

- Continue work to make example go

- Change output a little more

- Last changes needed to make create finish properly

- Fix config.go to use libmachine

- Cut down code duplication and make both methods work with libmachine

- Add pluggable logging implementation

- Return error when machine already in desired state

- Update example to show log method

- Fix file:// bug

- Fix Swarm defaults

- Remove unused TLS settings from Engine and Swarm options

- Remove spurious error

- Correct bug detecting if migration was performed

- Fix compilation errors from tests

- Fix most of remaining test issues

- Fix final silly bug in tests

- Remove extraneous debug code

- Add -race to test command

- Appease the gofmt

- Appease the generate coverage

- Making executive decision to remove Travis coverage check

In the early days I thought this would be a good idea because it would
encourage people to write tests in case they added a new module.  Well,
in fact it has just turned into a giant nuisance and made refactoring
work like this even more difficult.

- Move Get to Load
- Move HostListItem code to CLI

Signed-off-by: Nathan LeClaire <nathan.leclaire@gmail.com>
2015-09-23 12:30:15 -07:00