dhcp: timeout value is set in DHCP daemon
Eventually the timeout value will become a CLI argument The default timeout was nestled all the way in the lease constructor This commit is the first step in making the timeout configurable by moving it to the DHCPLease constructor Signed-off-by: toby lorne <toby@toby.codes>
This commit is contained in:
@ -26,6 +26,7 @@ import (
|
||||
"path/filepath"
|
||||
"runtime"
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
"github.com/containernetworking/cni/pkg/skel"
|
||||
"github.com/containernetworking/cni/pkg/types"
|
||||
@ -63,7 +64,7 @@ func (d *DHCP) Allocate(args *skel.CmdArgs, result *current.Result) error {
|
||||
|
||||
clientID := generateClientID(args.ContainerID, conf.Name, args.IfName)
|
||||
hostNetns := d.hostNetnsPrefix + args.Netns
|
||||
l, err := AcquireLease(clientID, hostNetns, args.IfName)
|
||||
l, err := AcquireLease(clientID, hostNetns, args.IfName, 5*time.Second)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
Reference in New Issue
Block a user