Commit Graph

141 Commits

Author SHA1 Message Date
Nathan LeClaire 5bba2b3a64 Merge pull request #2012 from nathanleclaire/forward_compat_configs
Add some small support for forward compatible configuration mistakes
2015-10-19 17:43:03 -07:00
Nathan LeClaire 7400a77b32 Add some small support for forward compatible configuration mistakes
Signed-off-by: Nathan LeClaire <nathan.leclaire@gmail.com>
2015-10-19 17:29:17 -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
Dave Henderson 2a6e3dbf40 Fix log.* method calls which meant to be log.*f
Stuff like `log.Debug("foo bar: %s", baz)` really wants to be
`log.Debugf("foo bar: %s", baz)`...

Signed-off-by: Dave Henderson <dhenderson@gmail.com>
2015-10-17 15:59:25 -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
Nathan LeClaire 7f18deb79f Merge pull request #1951 from nathanleclaire/windows_ssh
Fix Windows SSH issues
2015-10-13 17:53:18 -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
Kent Wang da26cab450 Remove TerminalLogger.
Signed-off-by: Kent Wang <pragkent@gmail.com>
2015-10-13 11:31:46 +08:00
Kent Wang 6f3648735c Fix filenames of loggers.
Signed-off-by: Kent Wang <pragkent@gmail.com>
2015-10-10 16:28:45 +08:00
Nathan LeClaire a7d08d9bcd Merge pull request #1950 from nathanleclaire/wonk_dial
Display error message only when create was otherwise successful
2015-10-08 16:34:03 -07:00
Kendrick Coleman 3ed0377956 clarified hostname error with valid characters
this is a fix for #1922 to add in a valid character error message.

Signed-off-by: Kendrick Coleman <kendrickcoleman@gmail.com>
2015-10-08 15:15:09 -04:00
Nathan LeClaire b1ed661da9 Display error message only when create was otherwise successful
Signed-off-by: Nathan LeClaire <nathan.leclaire@gmail.com>
2015-10-07 20:29:19 -07: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 a5b0ebe0ec Add --github-api-token flag and troubleshooting section
Signed-off-by: Nathan LeClaire <nathan.leclaire@gmail.com>
2015-10-06 15:12:18 -07:00
Evan Hazlett c4cd2385bf Merge pull request #1685 from nathanleclaire/daemon_wait_over_ssh
Fix Docker daemon wait
2015-09-24 16:56:37 -04:00
Olivier Gambier b6cb3e2b2d Tests fixes / silence build / add unit tests
Signed-off-by: Olivier Gambier <olivier@docker.com>
2015-09-23 16:51:54 -07:00
Nathan LeClaire 9453df4859 Fix Docker daemon wait
Also, a few various cleanups are bundled:

1. Only call GetDriver() once to get the object in provision/utils.go
2. SSH command wrapper will return the error and let the consumer decide
   what to do with it instead of bailing automatically on non-255

Signed-off-by: Nathan LeClaire <nathan.leclaire@gmail.com>
2015-09-23 15:19:25 -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
Olivier Gambier 09d3dad46b Fix vet errors and enforce vet on travis
Signed-off-by: Olivier Gambier <olivier@docker.com>
2015-09-19 16:09:44 -07:00
Evan Hazlett b8150450a6
fix debian provisioning bug with systemd
Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>
2015-09-17 15:16:18 -04:00
Xiaohui 102007b231 separate pkgaction into 'pkgaction' and 'serviceaction'
ignored IntellJ IDEA files

Signed-off-by: Xiaohui Liu <xiaohui.liu@ucloud.cn>
2015-09-17 11:15:38 +08:00
Nathan LeClaire f531eed130 Merge pull request #1848 from dmp42/5-hostsyntax
Fix #1846
2015-09-16 11:52:57 -07:00
Matt McNaughton a0b9d179b1 Fix Go Vet errors
This commit makes no changes to code execution, but rather resolves some
`go vet` errors, the majority of which relate to `fatal` being used
instead of `fatalf` during testing.

Signed-off-by: Matt McNaughton <mattjmcnaughton@gmail.com>
2015-09-14 22:37:16 -04:00
Olivier Gambier 009ed57719 Fix #1846
Signed-off-by: Olivier Gambier <viapanda@gmail.com>
2015-09-13 13:13:58 -07:00
Olivier Gambier 9d60bb7c73 Fmt fixes
Signed-off-by: Olivier Gambier <viapanda@gmail.com>
2015-09-10 18:27:13 -07:00
Evan Hazlett 08208bd141 Merge pull request #1463 from mschygulla/coreos-provisioner
Provisioner for CoreOS
2015-09-02 14:44:50 -04:00
Evan Hazlett ca2ab8c137
remove sudo -E for provisioning
Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>
2015-08-13 17:16:41 -04:00
Evan Hazlett 52a9c70277
debian/ubuntu: do not upgrade the system for a single package
Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>
2015-08-13 08:55:16 -04:00
Evan Hazlett f3f8b268e0
fixes upgrade for debian/ubuntu for new package name
Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>
2015-08-13 01:24:15 -04:00
Martin Schygulla 8328e96d93 Provisioner for CoreOS
Signed-off-by: Martin Schygulla <martin.schygulla@gmail.com>
2015-08-11 15:38:39 +02:00
Matt McNaughton 003770f2d4 Use a single function for checking active machine
Fix https://github.com/docker/machine/issues/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 <mattjmcnaughton@gmail.com>
2015-08-07 15:58:51 -04:00
Nathan LeClaire 8ba5a57072 Revert "Merge pull request #1552 from ehazlett/b2d-next"
This reverts commit 736ebb14fb, reversing
changes made to c6660bf62c.

Signed-off-by: Nathan LeClaire <nathan.leclaire@gmail.com>
2015-08-03 14:46:52 -07:00
Evan Hazlett 1469b3b704 Merge pull request #1612 from skatsuta/empty-dockerhost-active
libmachine: Filestore#GetActive() should return an error if DOCKER_HOST is empty
2015-07-31 05:15:08 -07:00
Evan Hazlett a51e4aaf5d Merge pull request #1620 from skatsuta/fix-hostname-test
libmachine: fix a test to check a host name is the same as expected
2015-07-31 05:05:58 -07:00
Soshi Katsuta 3f41f8ac4c libmachine: fix a test error message to show an expected host name
Signed-off-by: Soshi Katsuta <soshi.katsuta@gmail.com>
2015-07-31 16:38:00 +09:00
Soshi Katsuta c8987830b9 libmachine: fix a test to check the host name is right
Signed-off-by: Soshi Katsuta <soshi.katsuta@gmail.com>
2015-07-31 16:37:46 +09:00
Soshi Katsuta 47a890f27f libmachine: change an error message in Filestore#GetActive()
Signed-off-by: Soshi Katsuta <soshi.katsuta@gmail.com>
2015-07-31 16:05:54 +09:00
Evan Hazlett 751e80eefd Merge pull request #1597 from nathanleclaire/ls_timeout
Add Timeout state to ls command
2015-07-30 17:54:28 -07:00
Nathan LeClaire e9c285cf6a Add Timeout state to ls command
Signed-off-by: Nathan LeClaire <nathan.leclaire@gmail.com>
2015-07-30 13:44:40 -07:00
Soshi Katsuta aba294cbb1 libmachine: return an error if DOCKER_HOST is empty
Signed-off-by: Soshi Katsuta <soshi.katsuta@gmail.com>
2015-07-30 19:50:08 +09:00
Evan Hazlett 7614212d4f Merge pull request #1564 from nathanleclaire/revert_migration
Revert configuration migration removal, include new version field, and introduce migration boilerplate
2015-07-29 16:50:49 -07:00
Nathan LeClaire 802393f253 Skip and warn on wonky /etc/os-release lines
If the lines don't split cleanly (occasionally STDERR gets mixed in, for
instance, due to our current SSH output setup), we should simply
log.Warn in the output instead of bailing completely.

Signed-off-by: Nathan LeClaire <nathan.leclaire@gmail.com>
2015-07-28 18:07:51 -07:00
Nathan LeClaire fb2e843e99 - Re-introduce config migration; fix panics occurring from older configs
- Introduce boilerplate for config.json migrations

Signed-off-by: Nathan LeClaire <nathan.leclaire@gmail.com>
2015-07-28 15:38:16 -07:00
Evan Hazlett 736ebb14fb Merge pull request #1552 from ehazlett/b2d-next
VirtualBox: Update to support new B2D
2015-07-24 18:20:42 -04:00
Evan Hazlett 65b5624221
proper check for hyper-v during upgrade
Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>
2015-07-24 13:33:46 -04:00
Evan Hazlett 030783af74
swarm: use --advertise instead of --addr for join
Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>
2015-07-24 13:15:00 -04:00
Evan Hazlett 5af751ecf1
b2d: re-enable upgrade for local
Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>
2015-07-24 09:38:01 -04:00
Evan Hazlett cb80c434ac b2d: use direct urls until release; devicemapper for engine opts tests
Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>

b2d-ng: use driver names for iso versions

Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>
2015-07-24 09:07:01 -04:00
Evan Hazlett e09f2fdd9c vbox: change to get latest released iso instead of pre-release
Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>

vbox: fix windows share dir for homedir

Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>

vbox: update tests for b2d

Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>
2015-07-24 09:07:01 -04:00
Evan Hazlett ab31d52165 update vbox driver to work with new b2d
Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>

vbox: lock down shared folders to user home dir

Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>

use env var for user for cross platform

Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>

vbox: remove sudo from setting ssh key for user

Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>

wip: use homedir for share

Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>
2015-07-23 19:40:07 -04:00