mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Fix docker inspect display odd gateway value for none network mode
Signed-off-by: Lei Jitang <leijitang@huawei.com>
This commit is contained in:
parent
94811ae814
commit
7fa601adc7
1 changed files with 3 additions and 1 deletions
|
@ -714,7 +714,9 @@ func (container *Container) updateJoinInfo(n libnetwork.Network, ep libnetwork.E
|
||||||
// It is not an error to get an empty endpoint info
|
// It is not an error to get an empty endpoint info
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
container.NetworkSettings.Networks[n.Name()].Gateway = epInfo.Gateway().String()
|
if epInfo.Gateway() != nil {
|
||||||
|
container.NetworkSettings.Networks[n.Name()].Gateway = epInfo.Gateway().String()
|
||||||
|
}
|
||||||
if epInfo.GatewayIPv6().To16() != nil {
|
if epInfo.GatewayIPv6().To16() != nil {
|
||||||
container.NetworkSettings.Networks[n.Name()].IPv6Gateway = epInfo.GatewayIPv6().String()
|
container.NetworkSettings.Networks[n.Name()].IPv6Gateway = epInfo.GatewayIPv6().String()
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue