summaryrefslogtreecommitdiff
path: root/pkg/api/handlers/compat/containers.go
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2020-10-22 16:19:11 -0400
committerGitHub <noreply@github.com>2020-10-22 16:19:11 -0400
commita53a660313c6539c3e4a3558beb49836ca76d46f (patch)
tree3b887656f560a4d997a7456572738088e5ad8892 /pkg/api/handlers/compat/containers.go
parentd340f8523c9610644c8a195d1e3e9b3a5d32c5b3 (diff)
parent68419365257f1fcaa638605576a0583ef282a5a5 (diff)
downloadpodman-a53a660313c6539c3e4a3558beb49836ca76d46f.tar.gz
podman-a53a660313c6539c3e4a3558beb49836ca76d46f.tar.bz2
podman-a53a660313c6539c3e4a3558beb49836ca76d46f.zip
Merge pull request #8078 from baude/networkdisconnect
APIv2 compatibility network connect|disconnect
Diffstat (limited to 'pkg/api/handlers/compat/containers.go')
-rw-r--r--pkg/api/handlers/compat/containers.go23
1 files changed, 6 insertions, 17 deletions
diff --git a/pkg/api/handlers/compat/containers.go b/pkg/api/handlers/compat/containers.go
index cae8f88fd..00be8e845 100644
--- a/pkg/api/handlers/compat/containers.go
+++ b/pkg/api/handlers/compat/containers.go
@@ -410,25 +410,14 @@ func LibpodToContainerJSON(l *libpod.Container, sz bool) (*types.ContainerJSON,
return nil, err
}
- networkSettingsDefault := types.DefaultNetworkSettings{
- EndpointID: "",
- Gateway: "",
- GlobalIPv6Address: "",
- GlobalIPv6PrefixLen: 0,
- IPAddress: "",
- IPPrefixLen: 0,
- IPv6Gateway: "",
- MacAddress: l.Config().StaticMAC.String(),
- }
-
- networkSettingsBase := types.NetworkSettingsBase{
- Ports: ports,
+ n, err := json.Marshal(inspect.NetworkSettings)
+ if err != nil {
+ return nil, err
}
- networkSettings := types.NetworkSettings{
- NetworkSettingsBase: networkSettingsBase,
- DefaultNetworkSettings: networkSettingsDefault,
- Networks: nil,
+ networkSettings := types.NetworkSettings{}
+ if err := json.Unmarshal(n, &networkSettings); err != nil {
+ return nil, err
}
c := types.ContainerJSON{