mirror of
https://github.com/clearlinux/docker.git
synced 2026-09-06 21:51:33 +00:00
Implement requesting the name ip
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
This commit is contained in:
@@ -304,9 +304,18 @@ func createBridgeIface(name string) error {
|
||||
|
||||
// Allocate a network interface
|
||||
func Allocate(job *engine.Job) engine.Status {
|
||||
id := job.Args[0]
|
||||
var (
|
||||
ip *net.IP
|
||||
err error
|
||||
id = job.Args[0]
|
||||
requestedIP = net.ParseIP(job.Getenv("RequestedIP"))
|
||||
)
|
||||
|
||||
ip, err := ipallocator.RequestIP(bridgeNetwork, nil)
|
||||
if requestedIP != nil {
|
||||
ip, err = ipallocator.RequestIP(bridgeNetwork, &requestedIP)
|
||||
} else {
|
||||
ip, err = ipallocator.RequestIP(bridgeNetwork, nil)
|
||||
}
|
||||
if err != nil {
|
||||
job.Error(err)
|
||||
return engine.StatusErr
|
||||
|
||||
Reference in New Issue
Block a user