mirror of
https://github.com/moby/moby.git
synced 2026-01-11 18:51:37 +00:00
Remove network info from container when endpoint join fails
Signed-off-by: Rob Murray <rob.murray@docker.com>
This commit is contained in:
@@ -735,10 +735,14 @@ func (daemon *Daemon) connectToNetwork(ctx context.Context, cfg *config.Config,
|
||||
}
|
||||
}
|
||||
}()
|
||||
ctr.NetworkSettings.Networks[nwName] = endpointConfig
|
||||
|
||||
delete(ctr.NetworkSettings.Networks, n.ID())
|
||||
|
||||
ctr.NetworkSettings.Networks[nwName] = endpointConfig
|
||||
defer func() {
|
||||
if retErr != nil {
|
||||
delete(ctr.NetworkSettings.Networks, nwName)
|
||||
}
|
||||
}()
|
||||
if err := daemon.updateEndpointNetworkSettings(cfg, ctr, n, ep); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user