mirror of
https://github.com/containers/podman.git
synced 2025-10-18 19:53:58 +08:00
Fix libpod API conformance to swagger
* Return empty array when nothing has been pruned. * Use correct return type swagger doc-comment. Signed-off-by: Matej Vasek <mvasek@redhat.com>
This commit is contained in:
@ -1069,7 +1069,7 @@ func (s *APIServer) registerImagesHandlers(r *mux.Router) error {
|
||||
// - application/json
|
||||
// responses:
|
||||
// 200:
|
||||
// $ref: "#/responses/DocsImageDeleteResponse"
|
||||
// $ref: "#/responses/DocsLibpodPruneResponse"
|
||||
// 500:
|
||||
// $ref: '#/responses/InternalError'
|
||||
r.Handle(VersionedPath("/libpod/images/prune"), s.APIHandler(libpod.PruneImages)).Methods(http.MethodPost)
|
||||
|
@ -57,7 +57,7 @@ func (ir *ImageEngine) Prune(ctx context.Context, opts entities.ImagePruneOption
|
||||
pruneOptions.Filters = append(pruneOptions.Filters, "containers=false")
|
||||
}
|
||||
|
||||
var pruneReports []*reports.PruneReport
|
||||
pruneReports := make([]*reports.PruneReport, 0)
|
||||
|
||||
// Now prune all images until we converge.
|
||||
numPreviouslyRemovedImages := 1
|
||||
|
@ -218,6 +218,9 @@ if ! grep -q '400 Bad Request' "${TMPD}/headers.txt"; then
|
||||
BUILD_TEST_ERROR="1"
|
||||
fi
|
||||
|
||||
t POST libpod/images/prune 200
|
||||
t POST libpod/images/prune 200 length=0 []
|
||||
|
||||
cleanBuildTest
|
||||
if [[ "${BUILD_TEST_ERROR}" ]]; then
|
||||
exit 1
|
||||
|
Reference in New Issue
Block a user