diff options
author | Paul Holzinger <paul.holzinger@web.de> | 2021-02-09 22:45:18 +0100 |
---|---|---|
committer | Paul Holzinger <paul.holzinger@web.de> | 2021-02-09 23:03:48 +0100 |
commit | f2a856203117bf97a8dfa5960468ae70e4526e3e (patch) | |
tree | b00a0a3463197c460cf47981f9e3b1a3a4613a53 /pkg/api/handlers | |
parent | f98605e0e4f25c148b27cc617976357ff5b9d96e (diff) | |
download | podman-f2a856203117bf97a8dfa5960468ae70e4526e3e.tar.gz podman-f2a856203117bf97a8dfa5960468ae70e4526e3e.tar.bz2 podman-f2a856203117bf97a8dfa5960468ae70e4526e3e.zip |
Fix compat networks endpoint for a empty result
The networks list compat api endpoint must return `[]`
and not `null` if no networks are found.
Fixes #9293
Signed-off-by: Paul Holzinger <paul.holzinger@web.de>
Diffstat (limited to 'pkg/api/handlers')
-rw-r--r-- | pkg/api/handlers/compat/networks.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/pkg/api/handlers/compat/networks.go b/pkg/api/handlers/compat/networks.go index f7a70816f..85d2db87e 100644 --- a/pkg/api/handlers/compat/networks.go +++ b/pkg/api/handlers/compat/networks.go @@ -196,7 +196,7 @@ func ListNetworks(w http.ResponseWriter, r *http.Request) { return } - var reports []*types.NetworkResource + reports := []*types.NetworkResource{} logrus.Debugf("netNames: %q", strings.Join(netNames, ", ")) for _, name := range netNames { report, err := getNetworkResourceByNameOrID(name, runtime, query.Filters) |