Compare commits
15 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
702c267fc3 | ||
|
|
15cde711f7 | ||
|
|
46b43ebeea | ||
|
|
b36cb27a04 | ||
|
|
7909ee37a4 | ||
|
|
dccdee0102 | ||
|
|
69717945a4 | ||
|
|
7768a5bdaf | ||
|
|
9ec6729bad | ||
|
|
6c90ba4d3d | ||
|
|
7a9ce45749 | ||
|
|
dfdca21286 | ||
|
|
19035310d4 | ||
|
|
4f225c9543 | ||
|
|
eae38c196a |
19
.github/pull_request_template.md
vendored
Normal file
19
.github/pull_request_template.md
vendored
Normal 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
2
.gitignore
vendored
@@ -1,5 +1,5 @@
|
||||
*.log
|
||||
*.iml
|
||||
.idea/
|
||||
./bin
|
||||
/bin/
|
||||
cover
|
||||
|
||||
29
CHANGELOG.md
29
CHANGELOG.md
@@ -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
|
||||
|
||||
@@ -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.
|
||||
|
||||
|
||||
@@ -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
2
Gopkg.lock
generated
@@ -119,7 +119,7 @@
|
||||
"pkg/term",
|
||||
"pkg/term/windows"
|
||||
]
|
||||
revision = "bf1345d0b6d91f24e06d05e741897bc83cf8bab4"
|
||||
revision = "093424bec097cdf51154255226cf999d6824633b"
|
||||
|
||||
[[projects]]
|
||||
name = "github.com/docker/go-units"
|
||||
|
||||
@@ -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
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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{
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
@@ -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")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
@@ -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")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
@@ -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")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
@@ -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")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
|
||||
@@ -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)"
|
||||
|
||||
@@ -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" {
|
||||
|
||||
@@ -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" ]]
|
||||
|
||||
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user