mirror of
https://github.com/containers/podman.git
synced 2026-08-07 04:43:04 -04:00
Use abi PodPs implementation for libpod/pods/json endpoint
This removes unnecessary code duplication. Signed-off-by: Paul Holzinger <paul.holzinger@web.de>
This commit is contained in:
1 parent
38baf3d5e2
commit
82bce7d906
2 files changed
+6
-88
No files matched your search
@@ -43,6 +43,7 @@ func PodCreate(w http.ResponseWriter, r *http.Request) {
|
||||
}
|
||||
|
||||
func Pods(w http.ResponseWriter, r *http.Request) {
|
||||
runtime := r.Context().Value("runtime").(*libpod.Runtime)
|
||||
decoder := r.Context().Value("decoder").(*schema.Decoder)
|
||||
query := struct {
|
||||
Filters map[string][]string `schema:"filters"`
|
||||
@@ -55,7 +56,11 @@ func Pods(w http.ResponseWriter, r *http.Request) {
|
||||
return
|
||||
}
|
||||
|
||||
pods, err := utils.GetPods(w, r)
|
||||
containerEngine := abi.ContainerEngine{Libpod: runtime}
|
||||
podPSOptions := entities.PodPSOptions{
|
||||
Filters: query.Filters,
|
||||
}
|
||||
pods, err := containerEngine.PodPs(r.Context(), podPSOptions)
|
||||
if err != nil {
|
||||
utils.Error(w, "Something went wrong", http.StatusInternalServerError, err)
|
||||
return
|
||||
|
||||
Reference in new issue
Block a user