Change dhcp plugin to send ClientID allowing container to have multiple CNI
interfaces using dhcp ipam. Vendor latest dhcp4server, dhcp4client, dhcp4 Added additional tests for new functionality in dhcp2_test.go Wrap d2g dhcp4client calls with our own which add clientID to packet.
This commit is contained in:
@ -51,9 +51,7 @@ func newDHCP() *DHCP {
|
||||
}
|
||||
|
||||
func generateClientID(containerID string, netName string, ifName string) string {
|
||||
clientID := containerID + "/" + netName + "/" + ifName
|
||||
|
||||
return clientID
|
||||
return containerID + "/" + netName + "/" + ifName
|
||||
}
|
||||
|
||||
// Allocate acquires an IP from a DHCP server for a specified container.
|
||||
@ -118,7 +116,6 @@ func (d *DHCP) getLease(clientID string) *DHCPLease {
|
||||
return l
|
||||
}
|
||||
|
||||
//func (d *DHCP) setLease(contID, netName string, ifName string, l *DHCPLease) {
|
||||
func (d *DHCP) setLease(clientID string, l *DHCPLease) {
|
||||
d.mux.Lock()
|
||||
defer d.mux.Unlock()
|
||||
|
Reference in New Issue
Block a user