Skip to content

Commit 95ff1a2

Browse files
committed
Copy the external vmware driver to internal
Import github.com/machine-drivers/docker-machine-driver-vmware
1 parent 524347e commit 95ff1a2

File tree

12 files changed

+1215
-9
lines changed

12 files changed

+1215
-9
lines changed

go.mod

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ require (
3939
github.com/juju/mutex/v2 v2.0.0
4040
github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51
4141
github.com/klauspost/cpuid v1.2.0
42-
github.com/machine-drivers/docker-machine-driver-vmware v0.1.5
4342
github.com/mattbaird/jsonpatch v0.0.0-20200820163806-098863c1fc24
4443
github.com/mattn/go-isatty v0.0.20
4544
github.com/mitchellh/go-ps v1.0.0
@@ -258,5 +257,4 @@ require (
258257
replace (
259258
github.com/Parallels/docker-machine-parallels/v2 => github.com/minikube-machine/machine-driver-parallels/v2 v2.0.2-0.20240730142131-ada9375ea417
260259
github.com/docker/machine => github.com/minikube-machine/machine v0.0.0-20251109100456-3b479dcea7a3
261-
github.com/machine-drivers/docker-machine-driver-vmware => github.com/minikube-machine/machine-driver-vmware v0.1.6-0.20230701123042-a391c48b14d5
262260
)

go.sum

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,6 @@ github.com/docker/distribution v2.8.3+incompatible h1:AtKxIZ36LoNK51+Z6RpzLpddBi
182182
github.com/docker/distribution v2.8.3+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w=
183183
github.com/docker/docker v0.0.0-20180621001606-093424bec097/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk=
184184
github.com/docker/docker v17.12.0-ce-rc1.0.20181225093023-5ddb1d410a8b+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk=
185-
github.com/docker/docker v17.12.0-ce-rc1.0.20190115220918-5ec31380a5d3+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk=
186185
github.com/docker/docker v28.3.3+incompatible h1:Dypm25kh4rmk49v1eiVbsAtpAsYURjYkaKubwuBdxEI=
187186
github.com/docker/docker v28.3.3+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk=
188187
github.com/docker/docker-credential-helpers v0.9.3 h1:gAm/VtF9wgqJMoxzT3Gj5p4AqIjCBS4wrsOh9yRqcz8=
@@ -304,7 +303,6 @@ github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMyw
304303
github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
305304
github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
306305
github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
307-
github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
308306
github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
309307
github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
310308
github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
@@ -477,8 +475,6 @@ github.com/minikube-machine/machine v0.0.0-20251109100456-3b479dcea7a3 h1:LO7khk
477475
github.com/minikube-machine/machine v0.0.0-20251109100456-3b479dcea7a3/go.mod h1:wrzTHaSSmyll2TxLCq4mTFL5RJfeFr6qger+VcqNm9g=
478476
github.com/minikube-machine/machine-driver-parallels/v2 v2.0.2-0.20240730142131-ada9375ea417 h1:f+neTRGCtvmW3Tm1V72vWpoTPuNOnXSQsHZdYOryfGM=
479477
github.com/minikube-machine/machine-driver-parallels/v2 v2.0.2-0.20240730142131-ada9375ea417/go.mod h1:NKwI5KryEmEHMZVj80t9JQcfXWZp4/ZYNBuw4C5sQ9E=
480-
github.com/minikube-machine/machine-driver-vmware v0.1.6-0.20230701123042-a391c48b14d5 h1:1z7xOzfMO4aBR9+2nYjlhRXX1773fX60HTS0QGpGRPU=
481-
github.com/minikube-machine/machine-driver-vmware v0.1.6-0.20230701123042-a391c48b14d5/go.mod h1:HifYFOWR0bAMN4hWtaSADClogvtPy/jV0aRC5alhrKo=
482478
github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y=
483479
github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0=
484480
github.com/mitchellh/go-ps v1.0.0 h1:i6ampVEEF4wQFF+bkYfwYgY+F/uYJDktmvLPf7qIgjc=
@@ -618,7 +614,6 @@ github.com/shoenig/test v0.6.4 h1:kVTaSd7WLz5WZ2IaoM0RSzRsUD+m8wRR+5qvntpn4LU=
618614
github.com/shoenig/test v0.6.4/go.mod h1:byHiCGXqrVaflBLAMq/srcZIHynQPQgeyvkvXnjqq0k=
619615
github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc=
620616
github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo=
621-
github.com/sirupsen/logrus v1.3.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo=
622617
github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE=
623618
github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88=
624619
github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ=
@@ -727,7 +722,6 @@ go4.org v0.0.0-20180809161055-417644f6feb5/go.mod h1:MkTOUMDaeVYJUOUsaDXIhWPZYa1
727722
golang.org/x/build v0.0.0-20190927031335-2835ba2e683f h1:hXVePvSFG7tPGX4Pwk1d10ePFfoTCc0QmISfpKOHsS8=
728723
golang.org/x/build v0.0.0-20190927031335-2835ba2e683f/go.mod h1:fYw7AShPAhGMdXqA9gRadk/CcMsvLlClpE5oBwnS3dM=
729724
golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
730-
golang.org/x/crypto v0.0.0-20190103213133-ff983b9c42bc/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
731725
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
732726
golang.org/x/crypto v0.0.0-20190424203555-c05e17bb3b2d/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
733727
golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=

pkg/drivers/vmware/LICENSE

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
Copyright 2017 The Kubernetes Authors All rights reserved.
2+
Copyright 2017 VMware, Inc. All rights reserved.
3+
4+
Licensed under the Apache License, Version 2.0 (the "License");
5+
you may not use this file except in compliance with the License.
6+
You may obtain a copy of the License at
7+
8+
http://www.apache.org/licenses/LICENSE-2.0
9+
10+
Unless required by applicable law or agreed to in writing, software
11+
distributed under the License is distributed on an "AS IS" BASIS,
12+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
See the License for the specific language governing permissions and
14+
limitations under the License.

pkg/drivers/vmware/config.go

Lines changed: 138 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,138 @@
1+
/*
2+
Copyright 2017 The Kubernetes Authors All rights reserved.
3+
4+
Licensed under the Apache License, Version 2.0 (the "License");
5+
you may not use this file except in compliance with the License.
6+
You may obtain a copy of the License at
7+
8+
http://www.apache.org/licenses/LICENSE-2.0
9+
10+
Unless required by applicable law or agreed to in writing, software
11+
distributed under the License is distributed on an "AS IS" BASIS,
12+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
See the License for the specific language governing permissions and
14+
limitations under the License.
15+
*/
16+
17+
/*
18+
* Copyright 2017 VMware, Inc. All rights reserved. Licensed under the Apache v2 License.
19+
*/
20+
21+
package vmware
22+
23+
import (
24+
"github.com/docker/machine/libmachine/drivers"
25+
"github.com/docker/machine/libmachine/mcnflag"
26+
)
27+
28+
const (
29+
defaultSSHUser = "docker"
30+
defaultSSHPass = "tcuser"
31+
defaultDiskSize = 20000
32+
defaultCPU = 1
33+
defaultMemory = 1024
34+
defaultWaitIP = 30000
35+
defaultNetworkType = "nat"
36+
)
37+
38+
// Config specifies the configuration of driver VMware
39+
type Config struct {
40+
*drivers.BaseDriver
41+
42+
Memory int
43+
DiskSize int
44+
CPU int
45+
ISO string
46+
Boot2DockerURL string
47+
48+
SSHPassword string
49+
ConfigDriveISO string
50+
ConfigDriveURL string
51+
NoShare bool
52+
53+
WaitIP int
54+
NetworkType string
55+
}
56+
57+
// NewConfig creates a new Config
58+
func NewConfig(hostname, storePath string) *Config {
59+
return &Config{
60+
CPU: defaultCPU,
61+
Memory: defaultMemory,
62+
DiskSize: defaultDiskSize,
63+
SSHPassword: defaultSSHPass,
64+
WaitIP: defaultWaitIP,
65+
NetworkType: defaultNetworkType,
66+
BaseDriver: &drivers.BaseDriver{
67+
SSHUser: defaultSSHUser,
68+
MachineName: hostname,
69+
StorePath: storePath,
70+
},
71+
}
72+
}
73+
74+
// GetCreateFlags registers the flags this driver adds to
75+
// "docker hosts create"
76+
func (c *Config) GetCreateFlags() []mcnflag.Flag {
77+
return []mcnflag.Flag{
78+
mcnflag.StringFlag{
79+
EnvVar: "VMWARE_BOOT2DOCKER_URL",
80+
Name: "vmware-boot2docker-url",
81+
Usage: "URL for boot2docker image",
82+
Value: "",
83+
},
84+
mcnflag.StringFlag{
85+
EnvVar: "VMWARE_CONFIGDRIVE_URL",
86+
Name: "vmware-configdrive-url",
87+
Usage: "URL for cloud-init configdrive",
88+
Value: "",
89+
},
90+
mcnflag.IntFlag{
91+
EnvVar: "VMWARE_CPU_COUNT",
92+
Name: "vmware-cpu-count",
93+
Usage: "number of CPUs for the machine (-1 to use the number of CPUs available)",
94+
Value: defaultCPU,
95+
},
96+
mcnflag.IntFlag{
97+
EnvVar: "VMWARE_MEMORY_SIZE",
98+
Name: "vmware-memory-size",
99+
Usage: "size of memory for host VM (in MB)",
100+
Value: defaultMemory,
101+
},
102+
mcnflag.IntFlag{
103+
EnvVar: "VMWARE_DISK_SIZE",
104+
Name: "vmware-disk-size",
105+
Usage: "size of disk for host VM (in MB)",
106+
Value: defaultDiskSize,
107+
},
108+
mcnflag.StringFlag{
109+
EnvVar: "VMWARE_SSH_USER",
110+
Name: "vmware-ssh-user",
111+
Usage: "SSH user",
112+
Value: defaultSSHUser,
113+
},
114+
mcnflag.StringFlag{
115+
EnvVar: "VMWARE_SSH_PASSWORD",
116+
Name: "vmware-ssh-password",
117+
Usage: "SSH password",
118+
Value: defaultSSHPass,
119+
},
120+
mcnflag.BoolFlag{
121+
EnvVar: "VMWARE_NO_SHARE",
122+
Name: "vmware-no-share",
123+
Usage: "Disable the mount of your home directory",
124+
},
125+
mcnflag.IntFlag{
126+
EnvVar: "VMWARE_WAIT_IP",
127+
Name: "vmware-wait-ip",
128+
Usage: "time to wait for vmrun to get an ip (in milliseconds)",
129+
Value: defaultWaitIP,
130+
},
131+
mcnflag.StringFlag{
132+
EnvVar: "VMWARE_NETWORK_TYPE",
133+
Name: "vmware-network-type",
134+
Usage: "Network connection type to use (e.g. 'nat', 'bridged', 'hostonly')",
135+
Value: defaultNetworkType,
136+
},
137+
}
138+
}

0 commit comments

Comments
 (0)