Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 40 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Launch cmd",
"type": "go",
"request": "launch",
"mode": "auto",
"program": "cmd/docker-machine/machine.go",
"args": [
"env", "--shell", "powershell"
// "regenerate-certs", "--force"
],
"env": {
"MACHINE_PLUGIN_REATTACH": "127.0.0.1:55704",
"MACHINE_DEBUG": "1",
"MACHINE_NOHEART": "1",
"GODEBUG": "execerrdot=0"
},
"cwd": "${workspaceFolder}"
},
{
"name": "Launch plugin",
"type": "go",
"request": "launch",
"mode": "auto",
"program": "drivers/docker-machine-driver-vmware/main.go",
"args": [
],
"env": {
"MACHINE_DEBUG": "1",
"MACHINE_PLUGIN_TOKEN": "42",
"MACHINE_NOHEART": "1",
}
}
]
}
48 changes: 28 additions & 20 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,48 +1,56 @@
module github.com/docker/machine

go 1.13
go 1.20

require (
github.com/Azure/azure-sdk-for-go v5.0.0-beta+incompatible
github.com/Azure/go-autorest v7.2.1+incompatible
github.com/Nvveen/Gotty v0.0.0-20120604004816-cd527374f1e5 // indirect
github.com/aws/aws-sdk-go v1.4.10
github.com/bitly/go-simplejson v0.5.0 // indirect
github.com/bmizerany/assert v0.0.0-20160611221934-b7ed37b82869 // indirect
github.com/bugsnag/bugsnag-go v0.0.0-20151120182711-02e952891c52
github.com/bugsnag/osext v0.0.0-20130617224835-0dd3f918b21b // indirect
github.com/bugsnag/panicwrap v0.0.0-20160118154447-aceac81c6e2f // indirect
github.com/cenkalti/backoff v0.0.0-20141124221459-9831e1e25c87 // indirect
github.com/codegangsta/cli v0.0.0-20151120215642-0302d3914d2a
github.com/dgrijalva/jwt-go v0.0.0-20160831183534-24c63f56522a // indirect
github.com/digitalocean/godo v0.0.0-20170317202744-d59ed2fe842b
github.com/docker/docker v0.0.0-20180621001606-093424bec097 // indirect
github.com/docker/go-units v0.0.0-20151230175859-0bbddae09c5a // indirect
github.com/exoscale/egoscale v0.9.23
github.com/go-ini/ini v0.0.0-20151124192405-03e0e7d51a13 // indirect
github.com/golang/protobuf v0.0.0-20160221214941-3c84672111d9 // indirect
github.com/google/go-querystring v0.0.0-20140804062624-30f7a39f4a21 // indirect
github.com/gorilla/mux v1.8.0 // indirect
github.com/hectane/go-acl v0.0.0-20190604041725-da78bae5fc95
github.com/intel-go/cpuid v0.0.0-20181003105527-1a4a6f06a1c6
github.com/jinzhu/copier v0.0.0-20180308034124-7e38e58719c3 // indirect
github.com/jmespath/go-jmespath v0.0.0-20151117175822-3433f3ea46d9 // indirect
github.com/juju/loggo v1.0.0 // indirect
github.com/mitchellh/mapstructure v0.0.0-20140721150620-740c764bc614 // indirect
github.com/moby/term v0.0.0-20200416134343-063f2cd0b49d
github.com/rackspace/gophercloud v0.0.0-20150408191457-ce0f487f6747
github.com/samalba/dockerclient v0.0.0-20151231000007-f661dd4754aa
github.com/skarademir/naturalsort v0.0.0-20150715044055-69a5d87bef62
github.com/smartystreets/goconvey v1.7.2 // indirect
github.com/stretchr/testify v1.2.2
github.com/tent/http-link-go v0.0.0-20130702225549-ac974c61c2f9 // indirect
github.com/vmware/govcloudair v0.0.2
github.com/vmware/govmomi v0.6.2
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2
golang.org/x/net v0.0.0-20190311183353-d8887717615a
golang.org/x/oauth2 v0.0.0-20151117210313-442624c9ec92
golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527
google.golang.org/api v0.0.0-20180213000552-87a2f5c77b36
)

require (
github.com/Azure/go-ansiterm v0.0.0-20170929234023-d6e3b3328b78 // indirect
github.com/Nvveen/Gotty v0.0.0-20120604004816-cd527374f1e5 // indirect
github.com/bitly/go-simplejson v0.5.0 // indirect
github.com/bugsnag/osext v0.0.0-20130617224835-0dd3f918b21b // indirect
github.com/bugsnag/panicwrap v0.0.0-20160118154447-aceac81c6e2f // indirect
github.com/cenkalti/backoff v0.0.0-20141124221459-9831e1e25c87 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/dgrijalva/jwt-go v0.0.0-20160831183534-24c63f56522a // indirect
github.com/docker/docker v0.0.0-20180621001606-093424bec097 // indirect
github.com/docker/go-units v0.0.0-20151230175859-0bbddae09c5a // indirect
github.com/go-ini/ini v0.0.0-20151124192405-03e0e7d51a13 // indirect
github.com/golang/protobuf v0.0.0-20160221214941-3c84672111d9 // indirect
github.com/google/go-querystring v0.0.0-20140804062624-30f7a39f4a21 // indirect
github.com/gorilla/mux v1.8.0 // indirect
github.com/jinzhu/copier v0.0.0-20180308034124-7e38e58719c3 // indirect
github.com/jmespath/go-jmespath v0.0.0-20151117175822-3433f3ea46d9 // indirect
github.com/juju/loggo v1.0.0 // indirect
github.com/konsorten/go-windows-terminal-sequences v1.0.1 // indirect
github.com/mitchellh/mapstructure v0.0.0-20140721150620-740c764bc614 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/sirupsen/logrus v1.4.2 // indirect
github.com/smartystreets/goconvey v1.7.2 // indirect
github.com/stretchr/objx v0.1.1 // indirect
github.com/tent/http-link-go v0.0.0-20130702225549-ac974c61c2f9 // indirect
google.golang.org/appengine v0.0.0-20160205025855-6a436539be38 // indirect
google.golang.org/cloud v0.0.0-20151119220103-975617b05ea8 // indirect
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect
Expand Down
2 changes: 0 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ github.com/aws/aws-sdk-go v1.4.10 h1:edjsaZGVeOBOS5HBzvag8lfLZMFlQMNC+yCvM5roBro
github.com/aws/aws-sdk-go v1.4.10/go.mod h1:ZRmQr0FajVIyZ4ZzBYKG5P3ZqPz9IHG41ZoMu1ADI3k=
github.com/bitly/go-simplejson v0.5.0 h1:6IH+V8/tVMab511d5bn4M7EwGXZf9Hj6i2xSwkNEM+Y=
github.com/bitly/go-simplejson v0.5.0/go.mod h1:cXHtHw4XUPsvGaxgjIAn8PhEWG9NfngEKAMDJEczWVA=
github.com/bmizerany/assert v0.0.0-20160611221934-b7ed37b82869 h1:DDGfHa7BWjL4YnC6+E63dPcxHo2sUxDIu8g3QgEJdRY=
github.com/bmizerany/assert v0.0.0-20160611221934-b7ed37b82869/go.mod h1:Ekp36dRnpXw/yCqJaO+ZrUyxD+3VXMFFr56k5XYrpB4=
github.com/bugsnag/bugsnag-go v0.0.0-20151120182711-02e952891c52 h1:p8KmEtec4AQdLNtpfFlTMQCmO2ynjlPf93rUEuFqhkU=
github.com/bugsnag/bugsnag-go v0.0.0-20151120182711-02e952891c52/go.mod h1:2oa8nejYd4cQ/b0hMIopN0lCRxU0bueqREvZLWFrtK8=
github.com/bugsnag/osext v0.0.0-20130617224835-0dd3f918b21b h1:otBG+dV+YK+Soembjv71DPz3uX/V/6MMlSyD9JBQ6kQ=
Expand Down
15 changes: 15 additions & 0 deletions libmachine/drivers/plugin/localbinary/plugin.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ const (
PluginEnvKey = "MACHINE_PLUGIN_TOKEN"
PluginEnvVal = "42"
PluginEnvDriverName = "MACHINE_PLUGIN_DRIVER_NAME"
PluginEnvReattach = "MACHINE_PLUGIN_REATTACH"
)

type PluginStreamer interface {
Expand Down Expand Up @@ -112,6 +113,16 @@ func driverPath(driverName string) string {
}

func NewPlugin(driverName string) (*Plugin, error) {
reattachAddr := os.Getenv(PluginEnvReattach)
if (reattachAddr != "") {
addrCh := make(chan string, 1)
addrCh <- reattachAddr
return &Plugin{
stopCh: make(chan struct{}),
addrCh: addrCh,
}, nil
}

driverPath := driverPath(driverName)
binaryPath, err := exec.LookPath(driverPath)
if err != nil {
Expand Down Expand Up @@ -189,6 +200,10 @@ func (lbp *Plugin) AttachStream(scanner *bufio.Scanner) <-chan string {
}

func (lbp *Plugin) execServer() error {
if (lbp.Executor == nil) {
return nil
}

outScanner, errScanner, err := lbp.Executor.Start()
if err != nil {
return err
Expand Down
5 changes: 4 additions & 1 deletion libmachine/drivers/plugin/register_driver.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ Please use this plugin through the main 'docker-machine' binary.
`, version.APIVersion)
os.Exit(1)
}
noheartEnv := os.Getenv("MACHINE_NOHEART")

log.SetDebug(true)
os.Setenv("MACHINE_DEBUG", "1")
Expand Down Expand Up @@ -57,7 +58,9 @@ Please use this plugin through the main 'docker-machine' binary.
continue
case <-time.After(heartbeatTimeout):
// TODO: Add heartbeat retry logic
os.Exit(1)
if noheartEnv == "" {
os.Exit(1)
}
}
}
}
5 changes: 0 additions & 5 deletions vendor/github.com/hectane/go-acl/go.mod

This file was deleted.

2 changes: 0 additions & 2 deletions vendor/github.com/hectane/go-acl/go.sum

This file was deleted.

This file was deleted.

13 changes: 0 additions & 13 deletions vendor/github.com/moby/term/go.mod

This file was deleted.

33 changes: 0 additions & 33 deletions vendor/github.com/moby/term/go.sum

This file was deleted.

10 changes: 0 additions & 10 deletions vendor/github.com/sirupsen/logrus/go.mod

This file was deleted.

16 changes: 0 additions & 16 deletions vendor/github.com/sirupsen/logrus/go.sum

This file was deleted.

Loading