fail plugin operation on bridge attachment error

Fixes #2097.
This commit is contained in:
Matthias Radestock committed 2016-03-24 17:01:15 +00:00
1 parent ae0a4fef50
commit fce954192c
1 file changed
+6 -2
+6 -2
View File
@@ -135,11 +135,15 @@ func (driver *driver) JoinEndpoint(j *api.JoinRequest) (*api.JoinResponse, error
Log.Errorf("device %s is %+v", WeaveBridge, maybeBridge)
return nil, errorf(`device "%s" is of type "%s"`, WeaveBridge, maybeBridge.Type())
}
odp.AddDatapathInterface(WeaveBridge, local.Name)
if err := odp.AddDatapathInterface(WeaveBridge, local.Name); err != nil {
return nil, errorf(`failed to attach "%s" to device "%s": %s`, local.Name, WeaveBridge, err)
}
case *netlink.Device:
Log.Warnf("kernel does not report what kind of device %s is, just %+v", WeaveBridge, maybeBridge)
// Assume it's our openvswitch device, and the kernel has not been updated to report the kind.
odp.AddDatapathInterface(WeaveBridge, local.Name)
if err := odp.AddDatapathInterface(WeaveBridge, local.Name); err != nil {
return nil, errorf(`failed to attach "%s" to device "%s": %s`, local.Name, WeaveBridge, err)
}
default:
Log.Errorf("device %s is %+v", WeaveBridge, maybeBridge)
return nil, errorf(`device "%s" not a bridge`, WeaveBridge)