summaryrefslogtreecommitdiff
path: root/pkg/api
diff options
context:
space:
mode:
authorMatthew Heon <matthew.heon@pm.me>2020-08-04 15:51:13 -0400
committerMatthew Heon <matthew.heon@pm.me>2020-08-10 10:15:51 -0400
commit569854d6348e1cd74e8d654c88720e5517898f1a (patch)
tree8eaf3233da1ce1a4d1c3d39dc502a08e60307e2d /pkg/api
parentda00482ef29e0a04a690f1538391e38b0b951dd0 (diff)
downloadpodman-569854d6348e1cd74e8d654c88720e5517898f1a.tar.gz
podman-569854d6348e1cd74e8d654c88720e5517898f1a.tar.bz2
podman-569854d6348e1cd74e8d654c88720e5517898f1a.zip
Unconditionally retrieve pod names via API
The ListContainers API previously had a Pod parameter, which determined if pod name was returned (but, notably, not Pod ID, which was returned unconditionally). This was fairly confusing, so we decided to deprecate/remove the parameter and return it unconditionally. To do this without serious performance implications, we need to avoid expensive JSON decodes of pod configuration in the DB. The way our Bolt tables are structured, retrieving name given ID is actually quite cheap, but we did not expose this via the Libpod API. Add a new GetName API to do this. Fixes #7214 Signed-off-by: Matthew Heon <matthew.heon@pm.me>
Diffstat (limited to 'pkg/api')
-rw-r--r--pkg/api/handlers/libpod/containers.go3
-rw-r--r--pkg/api/server/register_containers.go3
2 files changed, 2 insertions, 4 deletions
diff --git a/pkg/api/handlers/libpod/containers.go b/pkg/api/handlers/libpod/containers.go
index 47ea6c40d..e343a9e0c 100644
--- a/pkg/api/handlers/libpod/containers.go
+++ b/pkg/api/handlers/libpod/containers.go
@@ -41,7 +41,6 @@ func ListContainers(w http.ResponseWriter, r *http.Request) {
Last int `schema:"last"` // alias for limit
Limit int `schema:"limit"`
Namespace bool `schema:"namespace"`
- Pod bool `schema:"pod"`
Size bool `schema:"size"`
Sync bool `schema:"sync"`
}{
@@ -72,7 +71,7 @@ func ListContainers(w http.ResponseWriter, r *http.Request) {
Size: query.Size,
Sort: "",
Namespace: query.Namespace,
- Pod: query.Pod,
+ Pod: true,
Sync: query.Sync,
}
pss, err := ps.GetContainerLists(runtime, opts)
diff --git a/pkg/api/server/register_containers.go b/pkg/api/server/register_containers.go
index edc1ee3c8..0ad5d29ea 100644
--- a/pkg/api/server/register_containers.go
+++ b/pkg/api/server/register_containers.go
@@ -661,11 +661,10 @@ func (s *APIServer) registerContainersHandlers(r *mux.Router) error {
// type: boolean
// description: Include namespace information
// default: false
- // - in: query
// name: pod
// type: boolean
// default: false
- // description: Include Pod ID and Name if applicable
+ // description: Ignored. Previously included details on pod name and ID that are currently included by default.
// - in: query
// name: size
// type: boolean