summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--pkg/api/handlers/libpod/pods.go2
-rw-r--r--test/apiv2/40-pods.at4
2 files changed, 5 insertions, 1 deletions
diff --git a/pkg/api/handlers/libpod/pods.go b/pkg/api/handlers/libpod/pods.go
index 8f8292567..82a7299b2 100644
--- a/pkg/api/handlers/libpod/pods.go
+++ b/pkg/api/handlers/libpod/pods.go
@@ -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
}
diff --git a/test/apiv2/40-pods.at b/test/apiv2/40-pods.at
index 3df541de5..fdb61a84d 100644
--- a/test/apiv2/40-pods.at
+++ b/test/apiv2/40-pods.at
@@ -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"