diff options
author | baude <bbaude@redhat.com> | 2020-01-19 10:39:50 -0600 |
---|---|---|
committer | Brent Baude <bbaude@redhat.com> | 2020-01-21 12:50:41 -0600 |
commit | 78e4e83e92b2c17ed59564e8f504f17008c7d269 (patch) | |
tree | 6090f92ae5a6f5aebf0711d05e9ad69bb2b39aeb /pkg/api/handlers/libpod/containers.go | |
parent | fb2bd26f7331ee3a1ca9690d9c2960ccadebc68f (diff) | |
download | podman-78e4e83e92b2c17ed59564e8f504f17008c7d269.tar.gz podman-78e4e83e92b2c17ed59564e8f504f17008c7d269.tar.bz2 podman-78e4e83e92b2c17ed59564e8f504f17008c7d269.zip |
[CI:DOCS]First pass at review comments
Tackling the first comments in the review pass. More to come.
Signed-off-by: baude <bbaude@redhat.com>
Signed-off-by: Brent Baude <bbaude@redhat.com>
Diffstat (limited to 'pkg/api/handlers/libpod/containers.go')
-rw-r--r-- | pkg/api/handlers/libpod/containers.go | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/pkg/api/handlers/libpod/containers.go b/pkg/api/handlers/libpod/containers.go index 388be24b6..e16a4ea1f 100644 --- a/pkg/api/handlers/libpod/containers.go +++ b/pkg/api/handlers/libpod/containers.go @@ -143,6 +143,22 @@ func CreateContainer(w http.ResponseWriter, r *http.Request) { } +func UnmountContainer(w http.ResponseWriter, r *http.Request) { + runtime := r.Context().Value("runtime").(*libpod.Runtime) + name := mux.Vars(r)["name"] + conn, err := runtime.LookupContainer(name) + if err != nil { + utils.ContainerNotFound(w, name, err) + return + } + // TODO In future it might be an improvement that libpod unmount return a + // "container not mounted" error so we can surface that to the endpoint user + if err := conn.Unmount(false); err != nil { + utils.InternalServerError(w, err) + } + utils.WriteResponse(w, http.StatusNoContent, "") + +} func MountContainer(w http.ResponseWriter, r *http.Request) { runtime := r.Context().Value("runtime").(*libpod.Runtime) name := mux.Vars(r)["name"] |