Compare commits

..

15 Commits

Author SHA1 Message Date
Joffrey F
702c267fc3 Bump version to 0.16.0
Signed-off-by: Joffrey F <joffrey@docker.com>
2018-11-08 12:18:11 -08:00
Grachev Mikhail
15cde711f7 Fix typo
Signed-off-by: Mikhail Grachev <work@mgrachev.com>
2018-10-31 16:39:58 -07:00
Julien Barbot
46b43ebeea Update path of golint
The new path is golang.org/x/lint/golint.
See ead987a65e.

Signed-off-by: Julien Barbot <jubarbot@cisco.com>
2018-10-31 16:39:04 -07:00
Florian Ludwig
b36cb27a04 openstack: don't fail when trying to delete non-existing keypair
Signed-off-by: Florian Ludwig <f.ludwig@greyrook.com>
2018-09-20 14:35:00 -07:00
liusheng
7909ee37a4 Fix integrate tests of core commands cases
Signed-off-by: liusheng <liusheng@huawei.com>
2018-09-19 17:01:26 -07:00
F. Eugene Aumson
dccdee0102 aws ec2 preqreq check: match error to filter
filter to search for a subnet searches by both regionZone and VpcId,
but when no matches were found, the error message neglected to mention
that the VPC ID was part of the search criteria

Signed-off-by: F. Eugene Aumson <feuGeneA@github.com>
2018-09-19 16:38:38 -07:00
F. Eugene Aumson
69717945a4 amazonec2: correct mis-handling of 'none' VPC
Without this change,

docker-machine create \
    --driver amazonec2 \
    --amazonec2-security-group parity-security-group \
    --amazonec2-instance-type t2.medium \
    --amazonec2-access-key ... \
    --amazonec2-secret-key ... \
    --amazonec2-root-size 128 \
    parity-node

yields the program output

Error with pre-create check: "unable to find a subnet in the zone: us-e
ast-1a"

which comes from drivers/amazonec2/amazonec2.go:506.

But that message is misleading.  After sprinkling in some
`fmt.Println`s, I discovered that the missing piece of info is not
actually the subnet, but rather the VPC ID, which is "none".

With this change, that same command now yields:

Error setting machine configuration from flags provided: amazonec2 driv
er requires either the --amazonec2-subnet-id or --amazonec2-vpc-id opti
on or an AWS Account with a default vpc-id

Signed-off-by: F. Eugene Aumson <feuGeneA@github.com>
2018-09-19 16:38:38 -07:00
Hiromu OCHIAI
7768a5bdaf Use latest docker/docker revision
Signed-off-by: Hiromu OCHIAI <otiai10@gmail.com>
2018-09-19 16:35:55 -07:00
liusheng
9ec6729bad Fix wrong docker daemon process name of engine options tests
Signed-off-by: liusheng <liusheng@huawei.com>
2018-09-19 16:35:13 -07:00
Yuki Nishiwaki
6c90ba4d3d Return error of command exec in SSH NativeClient
Signed-off-by: Yuki Nishiwaki <uckey.1067@gmail.com>
2018-09-19 16:33:08 -07:00
Tianon Gravi
7a9ce45749 Update "aufs" to "overlay2" in several places
Signed-off-by: Tianon Gravi <admwiggin@gmail.com>
2018-09-19 16:28:48 -07:00
Robert Rettig
dfdca21286 change default storage driver for redhat
Signed-off-by: Robert Rettig <robert.rettig@ndgit.com>
2018-09-19 16:27:30 -07:00
cygmris
19035310d4 fix invalid ignorance of bin directory
Signed-off-by: cygmris <root@schoolpot.org>
2018-07-13 15:55:25 -04:00
Joffrey F
4f225c9543 Add PR template
Signed-off-by: Joffrey F <joffrey@docker.com>
2018-07-13 15:50:20 -04:00
Joffrey F
eae38c196a Update CHANGELOG - v0.15.0
Signed-off-by: Joffrey F <joffrey@docker.com>
2018-06-12 16:57:20 -07:00
25 changed files with 120 additions and 32 deletions

19
.github/pull_request_template.md vendored Normal file
View File

@@ -0,0 +1,19 @@
<!--
Thank you for your interest in contributing to Docker Machine!
Please note that the project is now in MAINTENANCE MODE, meaning we will
no longer review or merge PRs that introduce new features, drivers or
provisioners. We will continue to consider and review proposed bug fixes
and dependency upgrades when appropriate.
Thank you for your understanding.
-->
## Description
<!-- In a couple sentences, explain what your PR does and what problem it fixes -->
## Related issue(s)
<!-- Include any issue from the tracker that this PR addresses or otherwise relates to -->

2
.gitignore vendored
View File

@@ -1,5 +1,5 @@
*.log
*.iml
.idea/
./bin
/bin/
cover

View File

@@ -1,5 +1,34 @@
# Changelog
# 0.15.0 (2018-06-12)
## General
- `docker-machine` can now be installed using `go install`.
- Now built with go 1.10
- Added keep-alive to SSH connections (#4450)
## Drivers
### amazonec2
- Updated default AMIs to mitigate Meltdown and Spectre
- Added `--amazonec2-security-group-readonly` flag to prevent mutating security groups
### exoscale
- Updated driver to v0.9.23
### hyperv
- Fixed Hyper-V pre-create issues (#4426)
- Added the ability to disable Hyper-V dynamic memory management during VM creation (`--hyperv-disable-dynamic-memory`)
### vmwarefusion
- Improved shell checks (#4491)
# 0.14.0 (2018-03-06)
## General

View File

@@ -47,7 +47,7 @@ the directory that contains your `src` directory, e.g.:
$ export GOPATH=/home/yourname/work
$ mkdir -p $GOPATH/src/github.com/docker
$ cd $GOPATH/src/github.com/docker && git clone git@github.com:docker/machine.git
$ cd machine
$ cd machine
At this point, simply run:
@@ -66,7 +66,7 @@ to clean-up build results.
## Tests and validation
We use the usual `go` tools for this, to run those commands you need at least the linter which you can
install with `go get -u github.com/golang/lint/golint`
install with `go get -u golang.org/x/lint/golint`
To run basic validation (dco, fmt), and the project unit tests, call:
@@ -223,7 +223,7 @@ in order to run the core tests on Red Hat Enterprise Linux on Amazon.
### Layout
The `test/integration` directory is layed out to divide up tests based on the
The `test/integration` directory is laid out to divide up tests based on the
areas which the test. If you are uncertain where to put yours, we are happy to
guide you.

View File

@@ -7,7 +7,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
sshfs \
&& rm -rf /var/lib/apt/lists/*
RUN go get github.com/golang/lint/golint \
RUN go get golang.org/x/lint/golint \
github.com/mattn/goveralls \
golang.org/x/tools/cover

2
Gopkg.lock generated
View File

@@ -119,7 +119,7 @@
"pkg/term",
"pkg/term/windows"
]
revision = "bf1345d0b6d91f24e06d05e741897bc83cf8bab4"
revision = "093424bec097cdf51154255226cf999d6824633b"
[[projects]]
name = "github.com/docker/go-units"

View File

@@ -503,7 +503,7 @@ func (d *Driver) checkPrereqs() error {
}
if len(subnets.Subnets) == 0 {
return fmt.Errorf("unable to find a subnet in the zone: %s", regionZone)
return fmt.Errorf("unable to find a subnet that is both in the zone %s and belonging to VPC ID %s", regionZone, d.VpcId)
}
d.SubnetId = *subnets.Subnets[0].SubnetId
@@ -1235,7 +1235,11 @@ func (d *Driver) getDefaultVPCId() (string, error) {
for _, attribute := range output.AccountAttributes {
if *attribute.AttributeName == "default-vpc" {
return *attribute.AttributeValues[0].AttributeValue, nil
value := *attribute.AttributeValues[0].AttributeValue
if value == "none" {
return "", errors.New("default-vpc is 'none'")
}
return value, nil
}
}

View File

@@ -227,6 +227,31 @@ func TestDefaultVPCIsMissing(t *testing.T) {
assert.Empty(t, vpc)
}
func TestDefaultVPCIsNone(t *testing.T) {
driver := NewDriver("machineFoo", "path")
attributeName := "default-vpc"
vpcName := "none"
driver.clientFactory = func() Ec2Client {
return &fakeEC2WithDescribe{
output: &ec2.DescribeAccountAttributesOutput{
AccountAttributes: []*ec2.AccountAttribute{
{
AttributeName: &attributeName,
AttributeValues: []*ec2.AccountAttributeValue{
{AttributeValue: &vpcName},
},
},
},
},
}
}
vpc, err := driver.getDefaultVPCId()
assert.EqualError(t, err, "default-vpc is 'none'")
assert.Empty(t, vpc)
}
func TestGetRegionZoneForDefaultEndpoint(t *testing.T) {
driver := NewCustomTestDriver(&fakeEC2WithLogin{})
driver.awsCredentialsFactory = NewValidAwsCredentials

View File

@@ -473,7 +473,15 @@ func (d *Driver) Remove() error {
if !d.ExistingKey {
log.Debug("deleting key pair...", map[string]string{"Name": d.KeyPairName})
if err := d.client.DeleteKeyPair(d, d.KeyPairName); err != nil {
return err
if gopherErr, ok := err.(*gophercloud.UnexpectedResponseCodeError); ok {
if gopherErr.Actual == http.StatusNotFound {
log.Warn("Keypair already deleted")
} else {
return err
}
} else {
return err
}
}
}
return nil

View File

@@ -76,7 +76,7 @@ func (api *Client) NewHost(driverName string, rawDriver []byte) (*host.Host, err
},
EngineOptions: &engine.Options{
InstallURL: drivers.DefaultEngineInstallURL,
StorageDriver: "aufs",
StorageDriver: "overlay2",
TLSVerify: true,
},
SwarmOptions: &swarm.Options{

View File

@@ -232,7 +232,7 @@ func (provisioner *Boot2DockerProvisioner) Provision(swarmOptions swarm.Options,
swarmOptions.Env = engineOptions.Env
if provisioner.EngineOptions.StorageDriver == "" {
provisioner.EngineOptions.StorageDriver = "aufs"
provisioner.EngineOptions.StorageDriver = "overlay2"
}
if err = provisioner.SetHostname(provisioner.Driver.GetMachineName()); err != nil {

View File

@@ -86,7 +86,7 @@ func (provisioner *DebianProvisioner) Provision(swarmOptions swarm.Options, auth
provisioner.EngineOptions = engineOptions
swarmOptions.Env = engineOptions.Env
storageDriver, err := decideStorageDriver(provisioner, "aufs", engineOptions.StorageDriver)
storageDriver, err := decideStorageDriver(provisioner, "overlay2", engineOptions.StorageDriver)
if err != nil {
return err
}

View File

@@ -14,7 +14,7 @@ func TestDebianDefaultStorageDriver(t *testing.T) {
p := NewDebianProvisioner(&fakedriver.Driver{}).(*DebianProvisioner)
p.SSHCommander = provisiontest.NewFakeSSHCommander(provisiontest.FakeSSHCommanderOptions{})
p.Provision(swarm.Options{}, auth.Options{}, engine.Options{})
if p.EngineOptions.StorageDriver != "aufs" {
t.Fatal("Default storage driver should be aufs")
if p.EngineOptions.StorageDriver != "overlay2" {
t.Fatal("Default storage driver should be overlay2")
}
}

View File

@@ -134,7 +134,7 @@ func (provisioner *RedHatProvisioner) Provision(swarmOptions swarm.Options, auth
swarmOptions.Env = engineOptions.Env
// set default storage driver for redhat
storageDriver, err := decideStorageDriver(provisioner, "devicemapper", engineOptions.StorageDriver)
storageDriver, err := decideStorageDriver(provisioner, "overlay2", engineOptions.StorageDriver)
if err != nil {
return err
}

View File

@@ -14,7 +14,7 @@ func TestRedHatDefaultStorageDriver(t *testing.T) {
p := NewRedHatProvisioner("", &fakedriver.Driver{})
p.SSHCommander = provisiontest.NewFakeSSHCommander(provisiontest.FakeSSHCommanderOptions{})
p.Provision(swarm.Options{}, auth.Options{}, engine.Options{})
if p.EngineOptions.StorageDriver != "devicemapper" {
t.Fatal("Default storage driver should be devicemapper")
if p.EngineOptions.StorageDriver != "overlay2" {
t.Fatal("Default storage driver should be overlay2")
}
}

View File

@@ -102,7 +102,7 @@ func (provisioner *UbuntuSystemdProvisioner) Provision(swarmOptions swarm.Option
provisioner.EngineOptions = engineOptions
swarmOptions.Env = engineOptions.Env
storageDriver, err := decideStorageDriver(provisioner, "aufs", engineOptions.StorageDriver)
storageDriver, err := decideStorageDriver(provisioner, "overlay2", engineOptions.StorageDriver)
if err != nil {
return err
}

View File

@@ -38,7 +38,7 @@ func TestUbuntuSystemdDefaultStorageDriver(t *testing.T) {
p := NewUbuntuSystemdProvisioner(&fakedriver.Driver{}).(*UbuntuSystemdProvisioner)
p.SSHCommander = provisiontest.NewFakeSSHCommander(provisiontest.FakeSSHCommanderOptions{})
p.Provision(swarm.Options{}, auth.Options{}, engine.Options{})
if p.EngineOptions.StorageDriver != "aufs" {
t.Fatal("Default storage driver should be aufs")
if p.EngineOptions.StorageDriver != "overlay2" {
t.Fatal("Default storage driver should be overlay2")
}
}

View File

@@ -118,7 +118,7 @@ func (provisioner *UbuntuProvisioner) Provision(swarmOptions swarm.Options, auth
provisioner.EngineOptions = engineOptions
swarmOptions.Env = engineOptions.Env
storageDriver, err := decideStorageDriver(provisioner, "aufs", engineOptions.StorageDriver)
storageDriver, err := decideStorageDriver(provisioner, "overlay2", engineOptions.StorageDriver)
if err != nil {
return err
}

View File

@@ -38,7 +38,7 @@ func TestUbuntuDefaultStorageDriver(t *testing.T) {
p := NewUbuntuProvisioner(&fakedriver.Driver{}).(*UbuntuProvisioner)
p.SSHCommander = provisiontest.NewFakeSSHCommander(provisiontest.FakeSSHCommanderOptions{})
p.Provision(swarm.Options{}, auth.Options{}, engine.Options{})
if p.EngineOptions.StorageDriver != "aufs" {
t.Fatal("Default storage driver should be aufs")
if p.EngineOptions.StorageDriver != "overlay2" {
t.Fatal("Default storage driver should be overlay2")
}
}

View File

@@ -233,7 +233,7 @@ func decideStorageDriver(p Provisioner, defaultDriver, suppliedDriver string) (s
if remoteFilesystemType == "btrfs" {
bestSuitedDriver = "btrfs"
} else {
bestSuitedDriver = "aufs"
bestSuitedDriver = defaultDriver
}
}
return bestSuitedDriver, nil

View File

@@ -321,11 +321,14 @@ func (client *NativeClient) Shell(args ...string) error {
if err := session.Shell(); err != nil {
return err
}
session.Wait()
if err := session.Wait(); err != nil {
return err
}
} else {
session.Run(strings.Join(args, " "))
if err := session.Run(strings.Join(args, " ")); err != nil {
return err
}
}
return nil
}

View File

@@ -16,5 +16,5 @@ vet:
lint:
$(if $(GOLINT), , \
$(error Please install golint: go get -u github.com/golang/lint/golint))
$(error Please install golint: go get -u golang.org/x/lint/golint))
@test -z "$$($(GOLINT) ./... 2>&1 | grep -v vendor/ | grep -v "cli/" | grep -v "amazonec2/" |grep -v "openstack/" |grep -v "softlayer/" | grep -v "should have comment" | tee /dev/stderr)"

View File

@@ -8,7 +8,7 @@ use_shared_machine
run machine inspect UNKNOWN
echo ${output}
[ "$status" -eq 1 ]
[[ ${lines[0]} =~ "Host does not exist: \"UNKNOWN\"" ]]
[[ ${lines[0]} =~ "Docker machine \"UNKNOWN\" does not exist" ]]
}
@test "$DRIVER: appears with ls" {
@@ -29,7 +29,7 @@ use_shared_machine
run machine create -d $DRIVER $NAME
echo ${output}
[ "$status" -eq 1 ]
[[ ${lines[0]} == "Host already exists: \"$NAME\"" ]]
[[ ${lines[0]} == "Docker machine \"$NAME\" already exists" ]]
}
@test "$DRIVER: run busybox container" {

View File

@@ -28,7 +28,7 @@ use_disposable_machine
@test "$DRIVER: test docker process envs" {
# get pid of docker process, check process envs for set Environment Variable from above test
run machine ssh $NAME 'sudo cat /proc/$(pgrep -f "docker [d]aemon")/environ'
run machine ssh $NAME 'sudo cat /proc/$(pgrep -f $(which dockerd))/environ'
echo ${output}
[ $status -eq 0 ]
[[ "${output}" =~ "TEST=VALUE" ]]

View File

@@ -6,7 +6,7 @@ import (
)
var (
Version = "0.15.0"
Version = "0.16.0"
// GitCommit will be overwritten automatically by the build system
GitCommit = "HEAD"