mirror of
https://github.com/podman-container-tools/podman.git
synced 2026-08-07 17:36:22 +00:00
fix APIv2 pods top of non-exist pod gets two response value
Signed-off-by: zhangguanzhang <zhangguanzhang@qq.com>
This commit is contained in:
parent
3352e8b0e6
commit
a4ffed91da
2 changed files with 5 additions and 1 deletions
|
|
@ -327,7 +327,7 @@ func PodTop(w http.ResponseWriter, r *http.Request) {
|
|||
name := utils.GetName(r)
|
||||
pod, err := runtime.LookupPod(name)
|
||||
if err != nil {
|
||||
utils.ContainerNotFound(w, name, err)
|
||||
utils.PodNotFound(w, name, err)
|
||||
return
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -102,6 +102,10 @@ t GET libpod/pods/stats?namesOrIDs=fakename 404 \
|
|||
|
||||
t DELETE libpod/pods/bar?force=true 200
|
||||
|
||||
# test the fake name
|
||||
t GET libpod/pods/fakename/top 404 \
|
||||
.cause="no such pod"
|
||||
|
||||
t GET libpod/pods/foo/top 200 \
|
||||
.Processes[0][-1]="/pause " \
|
||||
.Titles[-1]="COMMAND"
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue