mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2025-01-19 08:19:15 +08:00
fix: 修复容器未指定 IP 编辑显示报错问题 (#4519)
This commit is contained in:
parent
5a8d6db43e
commit
2501a9f78a
@ -416,10 +416,14 @@ func (u *ContainerService) ContainerInfo(req dto.OperationWithName) (*dto.Contai
|
|||||||
|
|
||||||
networkSettings := oldContainer.NetworkSettings
|
networkSettings := oldContainer.NetworkSettings
|
||||||
bridgeNetworkSettings := networkSettings.Networks[data.Network]
|
bridgeNetworkSettings := networkSettings.Networks[data.Network]
|
||||||
ipv4Address := bridgeNetworkSettings.IPAMConfig.IPv4Address
|
if bridgeNetworkSettings.IPAMConfig != nil {
|
||||||
ipv6Address := bridgeNetworkSettings.IPAMConfig.IPv6Address
|
ipv4Address := bridgeNetworkSettings.IPAMConfig.IPv4Address
|
||||||
data.Ipv4 = ipv4Address
|
data.Ipv4 = ipv4Address
|
||||||
data.Ipv6 = ipv6Address
|
ipv6Address := bridgeNetworkSettings.IPAMConfig.IPv6Address
|
||||||
|
data.Ipv6 = ipv6Address
|
||||||
|
} else {
|
||||||
|
data.Ipv4 = bridgeNetworkSettings.IPAddress
|
||||||
|
}
|
||||||
|
|
||||||
data.Cmd = oldContainer.Config.Cmd
|
data.Cmd = oldContainer.Config.Cmd
|
||||||
data.OpenStdin = oldContainer.Config.OpenStdin
|
data.OpenStdin = oldContainer.Config.OpenStdin
|
||||||
|
Loading…
x
Reference in New Issue
Block a user