Skip to content

Commit 30b9480

Browse files
committed
Create legacy links during endpoint Join
Legacy links were set up by ProgramExternalConnectivity, but removed by Leave (rather than RevokeExternalConnectivity). The options needed by legacy links are all available in Join, and Join will only be called once per Endpoint. So, create legacy links there. Signed-off-by: Rob Murray <rob.murray@docker.com>
1 parent dd9e289 commit 30b9480

File tree

2 files changed

+4
-8
lines changed

2 files changed

+4
-8
lines changed

libnetwork/drivers/bridge/bridge_linux.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1470,6 +1470,10 @@ func (d *driver) Join(ctx context.Context, nid, eid string, sboxKey string, jinf
14701470
}
14711471
}
14721472

1473+
if !network.config.EnableICC {
1474+
return d.link(network, endpoint, true)
1475+
}
1476+
14731477
return nil
14741478
}
14751479

@@ -1578,10 +1582,6 @@ func (d *driver) ProgramExternalConnectivity(ctx context.Context, nid, eid strin
15781582
return fmt.Errorf("failed to update bridge endpoint %.7s to store: %v", endpoint.id, err)
15791583
}
15801584

1581-
if !network.config.EnableICC {
1582-
return d.link(network, endpoint, true)
1583-
}
1584-
15851585
return nil
15861586
}
15871587

libnetwork/drivers/bridge/bridge_linux_test.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1014,10 +1014,6 @@ func TestLinkContainers(t *testing.T) {
10141014
}
10151015

10161016
err = d.Join(context.Background(), "net1", "ep2", "", te2, nil, sbOptions)
1017-
if err != nil {
1018-
t.Fatal(err)
1019-
}
1020-
err = d.ProgramExternalConnectivity(context.Background(), "net1", "ep2", "ep2", "ep2")
10211017
assert.Check(t, err != nil, "Expected Join to fail given link conditions are not satisfied")
10221018
checkLink(false)
10231019
}

0 commit comments

Comments
 (0)