103 Commits

Author SHA1 Message Date
Jason-ZW
56ab5f039b Add nonempty flag
Signed-off-by: Jason-ZW <zhenyang@rancher.com>
2018-06-11 16:00:03 +08:00
Motonori Shindo
e515a4be57 The parentheses are needed for the shell command to be executed properly.
If the shell command looks like

  "condition1 && command1 || condition2 && command2 || command3"

then condition2 will never be checked if condition1 is true and command1
exists normally. In order for this code to run expectedly, it should look
like

  "(condition1 && command1) || (condition2 && command2) || command3"

instead.

Specifically, with the code like

  "[ ! -d /Users ]&& sudo mkdir /Users; sudo mount --bind /mnt/hgfs/Users /Users || [ -f /usr/local/bin/vmhgfs-fuse ]&& sudo /usr/local/bin/vmhgfs-fuse -o allow_other .host:/Users /Users || sudo mount -t vmhgfs -o uid=$(id -u),gid=$(id -g) .host:/Users /Users"

if both "[ ! -d /Users ]" and "sudo mkdir /Users; sudo mount --bind
/mnt/hgfs/Users /Users" are true, then the existence of a file
/usr/local/bin/vmhgfs-fuse will never be examined and always be executed
even if the file doesn't exist. Consequently, it always fails.

Signed-off-by: Motonori Shindo <motonori@shin.do>
2018-05-25 01:14:47 +09:00
David Gageot
94b3b39a75 Merge pull request #4297 from tt/check-errors-when-creating-virtual-machine
Check errors when creating virtual machine
2018-01-28 10:08:46 -08:00
David Gageot
3bf5c69841 Fix lint errors on darwin
Signed-off-by: David Gageot <david@gageot.net>
2017-11-17 08:12:01 +01:00
Troels Thomsen
44e0d1ee32 Check errors when creating virtual machine
Signed-off-by: Troels Thomsen <troels@thomsen.io>
2017-10-30 12:35:09 +01:00
fate-grand-order
6edf9f6d90 fix some typos to make Go Report more happy
Signed-off-by: Helen <chenjg@harmonycloud.cn>
2017-08-10 10:30:27 -07:00
polawat phetra
628f4c256a Fix vsphere / vmwarefusion provisioning
Signed-off-by: Joffrey F <joffrey@docker.com>
2017-07-12 16:23:33 -07:00
Nathan LeClaire
d889abc352 Merge pull request #4082 from SvenDowideit/allow-rancheros-to-select-docker-version
Allow rancheros (all-non-b2d) to select a different Docker engine version using --engine-install-url
2017-05-31 16:02:27 -07:00
Sven Dowideit
39e6b192a6 Allow vmware drivers to work with non-boot2docker hosts
Signed-off-by: Sven Dowideit <SvenDowideit@home.org.au>
2017-05-30 13:50:25 +10:00
Sven Dowideit
2ea653b5e3 Allow rancheros to select a different Docker engine version using --engine-install-url
Signed-off-by: Sven Dowideit <SvenDowideit@home.org.au>
2017-05-30 11:58:50 +10:00
Aaron.L.Xu
bfd2546447 fix typos in project scope
Signed-off-by: Aaron.L.Xu <likexu@harmonycloud.cn>
2017-02-10 13:40:04 +08:00
Nathan LeClaire
c9e8a87a3b Fix driver CPU inconsistency
Signed-off-by: Nathan LeClaire <nathan.leclaire@gmail.com>
2016-06-13 16:06:08 -07:00
Markus Bukowski
fb4b50112d VMware Fusion: static ip addresses (dhcp) are evaluated
Signed-off-by: Markus Bukowski <me@mrbuk.de>
2016-04-10 18:46:36 +02:00
Elliot Wright
ced43e8a09 Updated VMWare Fusion driver to attempt to bind mount the share directory, to fix #2050.
Signed-off-by: Elliot Wright <elliot@elliotwright.co>
2016-03-02 14:37:35 +00:00
Aaron Turner
e790d9f47a Enable syncing time for VMWare Fusion guests
By default, VMWare Fusion does not sync the guest OS's time to the host
and when running Fusion+docker-machine on a laptop the guest clock will
drift and not resync which can create a variety of problems (such as
authentication issues with AWS, etc)

Signed-off-by: Aaron Turner <synfinatic@gmail.com>
2016-02-17 09:46:39 -08:00
Jean-Laurent de Morlhon
8eb22b411b Fix #2029 - local drivers dont run with engine-install-url
Signed-off-by: Jean-Laurent de Morlhon <jeanlaurent@morlhon.net>
2016-01-28 18:05:58 +01:00
Fabio Rapposelli
00040796e2 Fix shared folder mount on restart
Signed-off-by: Fabio Rapposelli <fabio@vmware.com>
2016-01-15 22:29:43 +01:00
Daehyeok Mun
278cc175a2 VMWARE Fusion get IP from multiple leases files
Change to try get IP from multiple dhcp leases files

Signed-off-by: Daehyeok Mun <daehyeok@gmail.com>
2016-01-09 01:26:23 -07:00
Jean-Laurent de Morlhon
42b1f4e811 Merge pull request #2721 from rediceli/master
Fix #2717, Driver vmwarefusion fail because of soft link
2016-01-04 17:34:01 +01:00
rediceli
ccb8c31827 Fix #2717, Driver vmwarefusion fail because of soft link
Signed-off-by: rediceli <redice.li@qq.com>
2016-01-05 00:00:06 +08:00
David Gageot
e143c68cf9 Merge pull request #2732 from dgageot/better-logs
Improve Start/Stop/Kill/Restart lifecycle/logs
2016-01-04 16:24:55 +01:00
David Gageot
9354fed274 Remove some duplication related to swarm
Signed-off-by: David Gageot <david@gageot.net>
2016-01-04 10:40:04 +01:00
David Gageot
855de0741a Logs for Kill
Signed-off-by: David Gageot <david@gageot.net>
2016-01-04 10:38:25 +01:00
David Gageot
e9aa75f021 Logs for Restart
Signed-off-by: David Gageot <david@gageot.net>
2016-01-04 10:38:25 +01:00
David Gageot
783d2b124e Logs for Start
Signed-off-by: David Gageot <david@gageot.net>
2016-01-04 10:38:25 +01:00
David Gageot
bbe76b5a26 Logs for Stop
Signed-off-by: David Gageot <david@gageot.net>
2016-01-04 10:38:25 +01:00
David Gageot
a7bd9e06d2 Update B2D cache in PreCreateCheck phase
Signed-off-by: David Gageot <david@gageot.net>
2015-12-18 11:14:59 +01:00
David Gageot
f3775f774c FIX #2553 Fusion Driver is supported only on darwin
Signed-off-by: David Gageot <david@gageot.net>
2015-12-11 15:46:47 +01:00
David Gageot
8a64fd4716 Merge pull request #2528 from jhoos/vmwarefusion-umask
Explicitly set umask before invoking vmrun in vmwarefusion
2015-12-10 09:24:09 +01:00
Jason Hoos
d5ff6b21ea Explicitly set umask before invoking vmrun in vmwarefusion
For some reason, invoking vmrun with the nogui option doesn't
work right if umask is set to not allow world-readable permissions
by default.  This seems to be true at least in VMware Fusion 7.0.x
through 8.0.1.  As a workaround, the driver now explicitly sets
the umask to 022 before invoking vmrun.

Signed-off-by: Jason Hoos <jhoos@maestrohealth.com>
2015-12-08 11:45:38 -06:00
Fabio Rapposelli
40aab51e6a Add id/gid option to mount when using vmhgfs
Signed-off-by: Fabio Rapposelli <fabio@vmware.com>
2015-12-01 05:47:37 +01:00
jviide
9d2ebb630a Add --vmwarefusion-no-share option
Add a vmwarefusion driver flag to disable the mounting of the /Users
directory. Name it --vmwarefusion-no-share to reflect the pre-existing
virtualbox driver option --virtualbox-no-share.

Also add a corresponding environment variable FUSION_NO_SHARE.

The code is basically identical to the virtualbox driver's
implementation.

Signed-off-by: Joachim Viide <jviide@iki.fi>
2015-11-19 13:00:45 +02:00
Vladimir Varankin
0735f3f447 fix drivers GetUrl to build propper IPv6 addr
Signed-off-by: Vladimir Varankin <nek.narqo+git@gmail.com>
2015-11-13 13:19:15 +03: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
11922080a1 FIX #2171 Fix faulty flag and add tests for SetConfigFromFlags
Signed-off-by: David Gageot <david@gageot.net>
2015-11-05 18:57:03 +01:00
David Gageot
6c5dc41e6d Revert "Remove useless duplication on GetSSHHostname"
This reverts commit b6462eb6d0.

Signed-off-by: David Gageot <david@gageot.net>
2015-10-26 18:47:14 +01:00
Nathan LeClaire
8b9291de64 Merge pull request #2033 from dmp42/03-cleanup
Code cleanup
2015-10-23 11:27:44 -07:00
Fabian Ruff
5021ffd2e7 support github enterprise urls for b2d downloads
This commit allows downloading boot2docker releases not only from the official releases url (https://api.github.com/repos/boot2docker/boot2docker/releases) but from arbitrary github repositories that publish releases with a boot2docker.iso artifact. It also supports downloading from github enterprise.

Signed-off-by: Fabian Ruff <fabian@progra.de>
2015-10-22 16:12:21 +02:00
Olivier Gambier
b6462eb6d0 Remove useless duplication on GetSSHHostname
Signed-off-by: Olivier Gambier <olivier@docker.com>
2015-10-21 13:48:13 -07:00
Olivier Gambier
bf3cd8b8f4 Remove useless duplication on PreCreateCheck
Signed-off-by: Olivier Gambier <olivier@docker.com>
2015-10-21 13:48:13 -07: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
Marcel Harkema
db9363ef46 Fix config drive support in VMware Fusion driver
Signed-off-by: Marcel Harkema <marcel@harkema.name>
2015-10-10 16:10:11 +02: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
Nathan LeClaire
b91c117238 Merge pull request #1816 from frapposelli/fusion-fuse-mount
Adding FUSE HGFS mount option
2015-09-16 16:07:31 -07:00
Nathan LeClaire
b52fa33056 Merge pull request #1479 from mschygulla/enhanced-vmwarefusion-driver
[Enhancement] VMware Fusion driver
2015-09-11 14:26:30 -07:00
Nathan LeClaire
5ba35ac2de Merge pull request #1812 from jclagache/master
1434-Added homebrew cask support for VMware Fusion
2015-09-11 14:21:39 -07:00
jclagache
ebbc45abea 1434-Added homebrew cask support for VMware Fusion
This aims to lookup for Vmware Fusion required binaries (vmrun and vmware-vdiskmanager) in the system path first before falling back in the default Vmware Fusion installing path.
Thereby, the vmwarefusion docker-machine driver can now be used even if Vmware Fusion is not installed in its default location (with brew cask for example).
Signed-off-by: Jean-Christophe Lagache <jclagache@gmail.com>
2015-09-08 13:39:56 +02:00
Fabio Rapposelli
c3ed882b76 Adding FUSE HGFS mount option
Signed-off-by: Fabio Rapposelli <fabio@vmware.com>
2015-09-07 17:31:21 +02:00
Evan Hazlett
3c712ae30a change debug env var to MACHINE_DEBUG
Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>
2015-09-05 08:57:03 -04:00
Fabio Rapposelli
ffe1a7940b [GH-1740] Fix cpu allocation bug
Signed-off-by: Fabio Rapposelli <fabio@vmware.com>
2015-08-20 15:40:06 +02:00