mirror of
https://github.com/containers/podman.git
synced 2025-05-20 00:27:03 +08:00
network db: add new strucutre to container create
Make sure we create new containers in the db with the correct structure. Also remove some unneeded code for alias handling. We no longer need this functions. The specgen format has not been changed for now. Signed-off-by: Paul Holzinger <pholzing@redhat.com>
This commit is contained in:
@ -637,9 +637,17 @@ func (p *Pod) Inspect() (*define.InspectPodData, error) {
|
||||
infraConfig.HostAdd = make([]string, 0, len(infra.config.HostAdd))
|
||||
infraConfig.HostAdd = append(infraConfig.HostAdd, infra.config.HostAdd...)
|
||||
}
|
||||
if len(infra.config.ContainerNetworkConfig.Networks) > 0 {
|
||||
infraConfig.Networks = make([]string, 0, len(infra.config.ContainerNetworkConfig.Networks))
|
||||
infraConfig.Networks = append(infraConfig.Networks, infra.config.ContainerNetworkConfig.Networks...)
|
||||
|
||||
networks, err := infra.networks()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
netNames := make([]string, 0, len(networks))
|
||||
for name := range networks {
|
||||
netNames = append(netNames, name)
|
||||
}
|
||||
if len(netNames) > 0 {
|
||||
infraConfig.Networks = netNames
|
||||
}
|
||||
infraConfig.NetworkOptions = infra.config.ContainerNetworkConfig.NetworkOptions
|
||||
infraConfig.PortBindings = makeInspectPortBindings(infra.config.ContainerNetworkConfig.PortMappings, nil)
|
||||
|
Reference in New Issue
Block a user