Skip to content

Commit f9a1590

Browse files
committed
Merge pull request #1131 from msabansal/staticip
Static ip support for windows
2 parents 26e40eb + 42326bc commit f9a1590

1 file changed

Lines changed: 11 additions & 2 deletions

File tree

drivers/windows/windows.go

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -417,6 +417,10 @@ func (d *driver) CreateEndpoint(nid, eid string, ifInfo driverapi.InterfaceInfo,
417417
}
418418
endpointStruct.Policies = append(endpointStruct.Policies, qosPolicies...)
419419

420+
if ifInfo.Address() != nil {
421+
endpointStruct.IPAddress = ifInfo.Address().IP
422+
}
423+
420424
configurationb, err := json.Marshal(endpointStruct)
421425
if err != nil {
422426
return err
@@ -452,8 +456,13 @@ func (d *driver) CreateEndpoint(nid, eid string, ifInfo driverapi.InterfaceInfo,
452456
n.endpoints[eid] = endpoint
453457
n.Unlock()
454458

455-
ifInfo.SetIPAddress(endpoint.addr)
456-
ifInfo.SetMacAddress(endpoint.macAddress)
459+
if ifInfo.Address() == nil {
460+
ifInfo.SetIPAddress(endpoint.addr)
461+
}
462+
463+
if macAddress == nil {
464+
ifInfo.SetMacAddress(endpoint.macAddress)
465+
}
457466

458467
return nil
459468
}

0 commit comments

Comments
 (0)