mirror of
https://github.com/containers/podman.git
synced 2025-10-19 12:12:36 +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
|
// - application/json
|
||||||
// responses:
|
// responses:
|
||||||
// 200:
|
// 200:
|
||||||
// $ref: "#/responses/DocsImageDeleteResponse"
|
// $ref: "#/responses/DocsLibpodPruneResponse"
|
||||||
// 500:
|
// 500:
|
||||||
// $ref: '#/responses/InternalError'
|
// $ref: '#/responses/InternalError'
|
||||||
r.Handle(VersionedPath("/libpod/images/prune"), s.APIHandler(libpod.PruneImages)).Methods(http.MethodPost)
|
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")
|
pruneOptions.Filters = append(pruneOptions.Filters, "containers=false")
|
||||||
}
|
}
|
||||||
|
|
||||||
var pruneReports []*reports.PruneReport
|
pruneReports := make([]*reports.PruneReport, 0)
|
||||||
|
|
||||||
// Now prune all images until we converge.
|
// Now prune all images until we converge.
|
||||||
numPreviouslyRemovedImages := 1
|
numPreviouslyRemovedImages := 1
|
||||||
|
@ -218,6 +218,9 @@ if ! grep -q '400 Bad Request' "${TMPD}/headers.txt"; then
|
|||||||
BUILD_TEST_ERROR="1"
|
BUILD_TEST_ERROR="1"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
t POST libpod/images/prune 200
|
||||||
|
t POST libpod/images/prune 200 length=0 []
|
||||||
|
|
||||||
cleanBuildTest
|
cleanBuildTest
|
||||||
if [[ "${BUILD_TEST_ERROR}" ]]; then
|
if [[ "${BUILD_TEST_ERROR}" ]]; then
|
||||||
exit 1
|
exit 1
|
||||||
|
Reference in New Issue
Block a user