From f28b08fe969b90f6823ec3001cc7472738a1bffc Mon Sep 17 00:00:00 2001 From: baude Date: Wed, 10 Feb 2021 15:48:14 -0600 Subject: Correct compat network prune response Correcting the structure of the compat network prune response. They should follow {"NetworksDeleted": [",...]} Fixes: #9310 Signed-off-by: baude --- pkg/api/handlers/compat/networks.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'pkg') diff --git a/pkg/api/handlers/compat/networks.go b/pkg/api/handlers/compat/networks.go index 85d2db87e..83c80aac9 100644 --- a/pkg/api/handlers/compat/networks.go +++ b/pkg/api/handlers/compat/networks.go @@ -400,6 +400,9 @@ func Prune(w http.ResponseWriter, r *http.Request) { utils.Error(w, "Something went wrong.", http.StatusInternalServerError, err) return } + type response struct { + NetworksDeleted []string + } var prunedNetworks []string //nolint for _, pr := range pruneReports { if pr.Error != nil { @@ -408,5 +411,5 @@ func Prune(w http.ResponseWriter, r *http.Request) { } prunedNetworks = append(prunedNetworks, pr.Name) } - utils.WriteResponse(w, http.StatusOK, prunedNetworks) + utils.WriteResponse(w, http.StatusOK, response{NetworksDeleted: prunedNetworks}) } -- cgit v1.2.3-54-g00ecf