mirror of
https://github.com/containers/podman.git
synced 2025-07-30 20:02:37 +08: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:
@ -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"
|
||||
|
Reference in New Issue
Block a user