Skip to content

Commit aea7a1e

Browse files
committed
Copy the external vmware driver to internal
Import github.com/machine-drivers/docker-machine-driver-vmware
1 parent 3a84d45 commit aea7a1e

File tree

12 files changed

+1215
-5
lines changed

12 files changed

+1215
-5
lines changed

go.mod

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

go.sum

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -475,8 +475,6 @@ github.com/minikube-machine/machine v0.0.0-20251109100456-3b479dcea7a3 h1:LO7khk
475475
github.com/minikube-machine/machine v0.0.0-20251109100456-3b479dcea7a3/go.mod h1:wrzTHaSSmyll2TxLCq4mTFL5RJfeFr6qger+VcqNm9g=
476476
github.com/minikube-machine/machine-driver-parallels/v2 v2.0.2-0.20240730142131-ada9375ea417 h1:f+neTRGCtvmW3Tm1V72vWpoTPuNOnXSQsHZdYOryfGM=
477477
github.com/minikube-machine/machine-driver-parallels/v2 v2.0.2-0.20240730142131-ada9375ea417/go.mod h1:NKwI5KryEmEHMZVj80t9JQcfXWZp4/ZYNBuw4C5sQ9E=
478-
github.com/minikube-machine/machine-driver-vmware v0.1.6-0.20230701123042-a391c48b14d5 h1:1z7xOzfMO4aBR9+2nYjlhRXX1773fX60HTS0QGpGRPU=
479-
github.com/minikube-machine/machine-driver-vmware v0.1.6-0.20230701123042-a391c48b14d5/go.mod h1:HifYFOWR0bAMN4hWtaSADClogvtPy/jV0aRC5alhrKo=
480478
github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y=
481479
github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0=
482480
github.com/mitchellh/go-ps v1.0.0 h1:i6ampVEEF4wQFF+bkYfwYgY+F/uYJDktmvLPf7qIgjc=

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)