File tree 1 file changed +13
-0
lines changed
1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -121,6 +121,7 @@ type cliOpts struct {
121
121
idStr string
122
122
vlans string
123
123
vxlans string
124
+ homingHost string
124
125
}
125
126
126
127
var opts cliOpts
@@ -174,6 +175,10 @@ func init() {
174
175
"alloc-subnet-len" ,
175
176
24 ,
176
177
"Subnet length of auto allocated subnets from the subnet pool" )
178
+ flagSet .StringVar (& opts .homingHost ,
179
+ "host" ,
180
+ "" ,
181
+ "Host name/label on which an ep needs to be created. Default is the local host " )
177
182
flagSet .StringVar (& opts .vxlans ,
178
183
"vxlans" ,
179
184
"" ,
@@ -249,6 +254,13 @@ func validateOpts() error {
249
254
opts .construct .Get () == CLI_CONSTRUCT_NW {
250
255
}
251
256
257
+ if opts .homingHost == "" {
258
+ opts .homingHost , err = os .Hostname ()
259
+ if err != nil {
260
+ log .Fatalf ("error obtaining the hostname, error %s \n " , err )
261
+ }
262
+ }
263
+
252
264
// default gw and mask parsing
253
265
if opts .subnetCidr == "" {
254
266
opts .subnetLen = 0
@@ -349,6 +361,7 @@ func main() {
349
361
epCfg .NetId = opts .netId
350
362
epCfg .IpAddress = opts .ipAddr
351
363
epCfg .ContName = opts .contName
364
+ epCfg .HomingHost = opts .homingHost
352
365
state = epCfg
353
366
}
354
367
case CLI_CONSTRUCT_NW :
You can’t perform that action at this time.
0 commit comments