mirror of
https://github.com/containers/podman.git
synced 2025-06-21 17:38:12 +08:00
Correct compat network prune response
Correcting the structure of the compat network prune response. They should follow {"NetworksDeleted": [<network_name>",...]} Fixes: #9310 Signed-off-by: baude <bbaude@redhat.com>
This commit is contained in:
@ -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})
|
||||
}
|
||||
|
Reference in New Issue
Block a user