mirror of
https://github.com/clearlinux/libnetwork.git
synced 2026-08-23 23:48:07 +00:00
Merge pull request #241 from Metaswitch/remote-driver-dstprefix
Update remote driver to use destination prefix.
This commit is contained in:
@@ -168,7 +168,7 @@ func (d *driver) Join(nid, eid types.UUID, sboxKey string, jinfo driverapi.JoinI
|
||||
return fmt.Errorf("no correlating interface %d in supplied interface names", i)
|
||||
}
|
||||
supplied := ifaceNames[i]
|
||||
if err := iface.SetNames(supplied.SrcName, supplied.DstName); err != nil {
|
||||
if err := iface.SetNames(supplied.SrcName, supplied.DstPrefix); err != nil {
|
||||
return errorWithRollback(fmt.Sprintf("failed to set interface name: %s", err), d.Leave(nid, eid))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -144,7 +144,7 @@ func (test *testEndpoint) SetNames(src string, dst string) error {
|
||||
test.t.Fatalf(`Wrong SrcName; expected "%s", got "%s"`, test.src, src)
|
||||
}
|
||||
if test.dst != dst {
|
||||
test.t.Fatalf(`Wrong DstName; expected "%s", got "%s"`, test.dst, dst)
|
||||
test.t.Fatalf(`Wrong DstPrefix; expected "%s", got "%s"`, test.dst, dst)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
@@ -217,8 +217,8 @@ func TestRemoteDriver(t *testing.T) {
|
||||
"ResolvConfPath": ep.resolvConfPath,
|
||||
"InterfaceNames": []map[string]interface{}{
|
||||
map[string]interface{}{
|
||||
"SrcName": ep.src,
|
||||
"DstName": ep.dst,
|
||||
"SrcName": ep.src,
|
||||
"DstPrefix": ep.dst,
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
@@ -120,8 +120,8 @@ type joinRequest struct {
|
||||
}
|
||||
|
||||
type ifaceName struct {
|
||||
SrcName string
|
||||
DstName string
|
||||
SrcName string
|
||||
DstPrefix string
|
||||
}
|
||||
|
||||
type joinResponse struct {
|
||||
|
||||
Reference in New Issue
Block a user