diff options
author | Paul Holzinger <pholzing@redhat.com> | 2021-06-08 10:55:02 +0200 |
---|---|---|
committer | Paul Holzinger <pholzing@redhat.com> | 2021-06-08 11:38:26 +0200 |
commit | 8378a9c4df9af5f5cc72a3515ca65d1e3ca011a0 (patch) | |
tree | 3e479a5ff9e4facefbb0bd4fa2aaead302a96635 /pkg/api/handlers/compat | |
parent | 9a3a7327fdafaac66c99130a6729e4bcde8df0b0 (diff) | |
download | podman-8378a9c4df9af5f5cc72a3515ca65d1e3ca011a0.tar.gz podman-8378a9c4df9af5f5cc72a3515ca65d1e3ca011a0.tar.bz2 podman-8378a9c4df9af5f5cc72a3515ca65d1e3ca011a0.zip |
Fix network prune api docs
The api doc used wrong response examples for both the compat and libpod
network prune endpoints. Change the doc so that it matches the actual
return values. Also fix the endpoints to return an empty array instead
of null when no networks are removed.
[NO TESTS NEEDED]
Fixes: #10564
Signed-off-by: Paul Holzinger <pholzing@redhat.com>
Diffstat (limited to 'pkg/api/handlers/compat')
-rw-r--r-- | pkg/api/handlers/compat/networks.go | 2 | ||||
-rw-r--r-- | pkg/api/handlers/compat/swagger.go | 7 |
2 files changed, 1 insertions, 8 deletions
diff --git a/pkg/api/handlers/compat/networks.go b/pkg/api/handlers/compat/networks.go index 77ed548d8..04f8570ff 100644 --- a/pkg/api/handlers/compat/networks.go +++ b/pkg/api/handlers/compat/networks.go @@ -414,7 +414,7 @@ func Prune(w http.ResponseWriter, r *http.Request) { type response struct { NetworksDeleted []string } - var prunedNetworks []string //nolint + prunedNetworks := []string{} for _, pr := range pruneReports { if pr.Error != nil { logrus.Error(pr.Error) diff --git a/pkg/api/handlers/compat/swagger.go b/pkg/api/handlers/compat/swagger.go index a0783e723..b773799ef 100644 --- a/pkg/api/handlers/compat/swagger.go +++ b/pkg/api/handlers/compat/swagger.go @@ -77,10 +77,3 @@ type swagCompatNetworkDisconnectRequest struct { // in:body Body struct{ types.NetworkDisconnect } } - -// Network prune -// swagger:response NetworkPruneResponse -type swagCompatNetworkPruneResponse struct { - // in:body - Body []string -} |