diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2021-05-04 15:33:16 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-05-04 15:33:16 +0200 |
commit | dea6189982b4d128aa1ae9ce379a1f94b4eb8a8f (patch) | |
tree | 18690ab38a50025b5606b9bd2b09fb19afbaccc1 /pkg | |
parent | 52048426e25449f8f62ab2495d0bb5e98ea35506 (diff) | |
parent | f185666da8cc3af053f4d794d249f2fedc6e67e4 (diff) | |
download | podman-dea6189982b4d128aa1ae9ce379a1f94b4eb8a8f.tar.gz podman-dea6189982b4d128aa1ae9ce379a1f94b4eb8a8f.tar.bz2 podman-dea6189982b4d128aa1ae9ce379a1f94b4eb8a8f.zip |
Merge pull request #10206 from Luap99/fix-9837
compat api: Networks must be empty instead of null
Diffstat (limited to 'pkg')
-rw-r--r-- | pkg/api/handlers/compat/containers.go | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/pkg/api/handlers/compat/containers.go b/pkg/api/handlers/compat/containers.go index d97a4d3bd..263d64a7b 100644 --- a/pkg/api/handlers/compat/containers.go +++ b/pkg/api/handlers/compat/containers.go @@ -22,6 +22,7 @@ import ( "github.com/containers/podman/v3/pkg/util" "github.com/docker/docker/api/types" "github.com/docker/docker/api/types/container" + "github.com/docker/docker/api/types/network" "github.com/docker/go-connections/nat" "github.com/docker/go-units" "github.com/gorilla/schema" @@ -526,6 +527,10 @@ func LibpodToContainerJSON(l *libpod.Container, sz bool) (*types.ContainerJSON, if err := json.Unmarshal(n, &networkSettings); err != nil { return nil, err } + // do not report null instead use an empty map + if networkSettings.Networks == nil { + networkSettings.Networks = map[string]*network.EndpointSettings{} + } c := types.ContainerJSON{ ContainerJSONBase: &cb, |