diff options
author | baude <bbaude@redhat.com> | 2020-10-20 12:10:58 -0500 |
---|---|---|
committer | baude <bbaude@redhat.com> | 2020-10-22 08:20:28 -0500 |
commit | 68419365257f1fcaa638605576a0583ef282a5a5 (patch) | |
tree | c2020528598b5cbff0ac22f71d392af9c9f4112e /pkg/api/handlers/compat/containers.go | |
parent | 2cd2359a6d9ba4135495dc9be616bb1edebb170d (diff) | |
download | podman-68419365257f1fcaa638605576a0583ef282a5a5.tar.gz podman-68419365257f1fcaa638605576a0583ef282a5a5.tar.bz2 podman-68419365257f1fcaa638605576a0583ef282a5a5.zip |
APIv2 compatibility network connect|disconnect
Add endpoints for the compat layer for network connect and disconnect. As of now, these two endpoints do nothing to change the network state of a container. They do some basic data verification and return the proper 200 response. This at least allows for scripts to work on the compatibility layer instead of getting 404s.
Signed-off-by: baude <bbaude@redhat.com>
Diffstat (limited to 'pkg/api/handlers/compat/containers.go')
-rw-r--r-- | pkg/api/handlers/compat/containers.go | 23 |
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{ |