mirror of https://github.com/containers/podman.git
Merge pull request #7569 from zhangguanzhang/fix-apiv2-top-response-two-value
fix APIv2 pods top of non-exist pod gets two response value
This commit is contained in:
commit
1b2b068ce8
|
@ -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…
Reference in New Issue