Use more chars from endpointID to reduce clashes
This commit is contained in:
1 parent
5d598a1015
commit
7455a699c4
1 file changed
+2
-2
@@ -79,7 +79,7 @@ func (driver *driver) CreateEndpoint(create *api.CreateEndpointRequest) (*api.Cr
|
|||||||
if create.Interface == nil {
|
if create.Interface == nil {
|
||||||
return nil, fmt.Errorf("Not supported: creating an interface from within CreateEndpoint")
|
return nil, fmt.Errorf("Not supported: creating an interface from within CreateEndpoint")
|
||||||
}
|
}
|
||||||
// create veths. note we assume endpoint IDs are unique in the first 5 chars
|
// create veths. note we assume endpoint IDs are unique in the first 8 chars
|
||||||
local := vethPair(endID)
|
local := vethPair(endID)
|
||||||
if err := netlink.LinkAdd(local); err != nil {
|
if err := netlink.LinkAdd(local); err != nil {
|
||||||
return nil, errorf("could not create veth pair: %s", err)
|
return nil, errorf("could not create veth pair: %s", err)
|
||||||
@@ -205,7 +205,7 @@ func (driver *driver) DiscoverDelete(disco *api.DiscoveryNotification) error {
|
|||||||
// ===
|
// ===
|
||||||
|
|
||||||
func vethPair(endpointID string) *netlink.Veth {
|
func vethPair(endpointID string) *netlink.Veth {
|
||||||
suffix := endpointID[:5]
|
suffix := endpointID[:8]
|
||||||
return &netlink.Veth{
|
return &netlink.Veth{
|
||||||
LinkAttrs: netlink.LinkAttrs{Name: "vethwl" + suffix},
|
LinkAttrs: netlink.LinkAttrs{Name: "vethwl" + suffix},
|
||||||
PeerName: "vethwg" + suffix,
|
PeerName: "vethwg" + suffix,
|
||||||
|
|||||||
Reference in new issue
Block a user