daemon: Daemon.connectToNetwork: rename named return to prevent shadowing
The output var was used in a `defer`, but named `err` and shadowed in various places. Rename the var to a more explicit name to make clear where it's used and to prevent it being accidentally shadowed. Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
parent
c3c1ee0150
commit
00a863b25e
1 changed files with 3 additions and 3 deletions
|
@ -679,7 +679,7 @@ func buildEndpointDNSNames(ctr *container.Container, aliases []string) []string
|
|||
return sliceutil.Dedup(dnsNames)
|
||||
}
|
||||
|
||||
func (daemon *Daemon) connectToNetwork(cfg *config.Config, container *container.Container, idOrName string, endpointConfig *networktypes.EndpointSettings, updateSettings bool) (err error) {
|
||||
func (daemon *Daemon) connectToNetwork(cfg *config.Config, container *container.Container, idOrName string, endpointConfig *networktypes.EndpointSettings, updateSettings bool) (retErr error) {
|
||||
start := time.Now()
|
||||
if container.HostConfig.NetworkMode.IsContainer() {
|
||||
return runconfig.ErrConflictSharedNetwork
|
||||
|
@ -737,8 +737,8 @@ func (daemon *Daemon) connectToNetwork(cfg *config.Config, container *container.
|
|||
return err
|
||||
}
|
||||
defer func() {
|
||||
if err != nil {
|
||||
if e := ep.Delete(false); e != nil {
|
||||
if retErr != nil {
|
||||
if err := ep.Delete(false); err != nil {
|
||||
log.G(context.TODO()).Warnf("Could not rollback container connection to network %s", idOrName)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue