@@ -26,12 +26,13 @@ import (
26
26
)
27
27
28
28
const (
29
- defaultSSHUser = "docker"
30
- defaultSSHPass = "tcuser"
31
- defaultDiskSize = 20000
32
- defaultCPU = 1
33
- defaultMemory = 1024
34
- defaultWaitIP = 30000
29
+ defaultSSHUser = "docker"
30
+ defaultSSHPass = "tcuser"
31
+ defaultDiskSize = 20000
32
+ defaultCPU = 1
33
+ defaultMemory = 1024
34
+ defaultWaitIP = 30000
35
+ defaultConnectionType = "nat"
35
36
)
36
37
37
38
// Config specifies the configuration of driver VMware
@@ -49,17 +50,19 @@ type Config struct {
49
50
ConfigDriveURL string
50
51
NoShare bool
51
52
52
- WaitIP int
53
+ WaitIP int
54
+ ConnectionType string
53
55
}
54
56
55
57
// NewConfig creates a new Config
56
58
func NewConfig (hostname , storePath string ) * Config {
57
59
return & Config {
58
- CPU : defaultCPU ,
59
- Memory : defaultMemory ,
60
- DiskSize : defaultDiskSize ,
61
- SSHPassword : defaultSSHPass ,
62
- WaitIP : defaultWaitIP ,
60
+ CPU : defaultCPU ,
61
+ Memory : defaultMemory ,
62
+ DiskSize : defaultDiskSize ,
63
+ SSHPassword : defaultSSHPass ,
64
+ WaitIP : defaultWaitIP ,
65
+ ConnectionType : defaultConnectionType ,
63
66
BaseDriver : & drivers.BaseDriver {
64
67
SSHUser : defaultSSHUser ,
65
68
MachineName : hostname ,
@@ -125,5 +128,11 @@ func (c *Config) GetCreateFlags() []mcnflag.Flag {
125
128
Usage : "time to wait for vmrun to get an ip (in milliseconds)" ,
126
129
Value : defaultWaitIP ,
127
130
},
131
+ mcnflag.StringFlag {
132
+ EnvVar : "VMWARE_CONNECTION_TYPE" ,
133
+ Name : "vmware-connection-type" ,
134
+ Usage : "Network connection type to use (e.g. 'nat', 'bridged', 'hostonly')" ,
135
+ Value : defaultConnectionType ,
136
+ },
128
137
}
129
138
}
0 commit comments