1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

ovmanager: Error out on vxlan id alloc failure

Currently ovmanager simply logs an error when there is a vni allocation
failure. Instead it should error out and free all the previously
allocated vnis

Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
This commit is contained in:
Jana Radhakrishnan 2016-06-28 13:46:22 -07:00
parent b3fc24768b
commit de766cc7e6

View file

@ -2,7 +2,6 @@ package ovmanager
import (
"fmt"
"log"
"net"
"strconv"
"strings"
@ -111,7 +110,8 @@ func (d *driver) NetworkAllocate(id string, option map[string]string, ipV4Data,
}
if err := n.obtainVxlanID(s); err != nil {
log.Printf("Could not obtain vxlan id for pool %s: %v", s.subnetIP, err)
n.releaseVxlanID()
return nil, fmt.Errorf("could not obtain vxlan id for pool %s: %v", s.subnetIP, err)
}
n.subnets = append(n.subnets, s)