summaryrefslogtreecommitdiff
path: root/cmd/kpod/umount.go
diff options
context:
space:
mode:
authorumohnani8 <umohnani@redhat.com>2017-11-22 10:46:47 -0500
committerAtomic Bot <atomic-devel@projectatomic.io>2017-11-22 18:23:19 +0000
commit40dce698d3359a6bf89ed954a483454daf2e9fb2 (patch)
treecf74dab73a15c54f021f6a131da1dcfe8cbe3cbe /cmd/kpod/umount.go
parent34ba0cb8a922347364afaa14f199409ad7dc2451 (diff)
downloadpodman-40dce698d3359a6bf89ed954a483454daf2e9fb2.tar.gz
podman-40dce698d3359a6bf89ed954a483454daf2e9fb2.tar.bz2
podman-40dce698d3359a6bf89ed954a483454daf2e9fb2.zip
Update kpod mount and umount to use the new state
The new state for containers has been added moved kpod mount and umount over to use it Signed-off-by: Urvashi Mohnani <umohnani@redhat.com> Closes: #57 Approved by: rhatdan
Diffstat (limited to 'cmd/kpod/umount.go')
-rw-r--r--cmd/kpod/umount.go21
1 files changed, 10 insertions, 11 deletions
diff --git a/cmd/kpod/umount.go b/cmd/kpod/umount.go
index bad6752ab..4b6aba99e 100644
--- a/cmd/kpod/umount.go
+++ b/cmd/kpod/umount.go
@@ -17,6 +17,12 @@ var (
)
func umountCmd(c *cli.Context) error {
+ runtime, err := getRuntime(c)
+ if err != nil {
+ return errors.Wrapf(err, "could not get runtime")
+ }
+ defer runtime.Shutdown(false)
+
args := c.Args()
if len(args) == 0 {
return errors.Errorf("container ID must be specified")
@@ -24,18 +30,11 @@ func umountCmd(c *cli.Context) error {
if len(args) > 1 {
return errors.Errorf("too many arguments specified")
}
- config, err := getConfig(c)
- if err != nil {
- return errors.Wrapf(err, "Could not get config")
- }
- store, err := getStore(config)
- if err != nil {
- return err
- }
- err = store.Unmount(args[0])
+ ctr, err := runtime.LookupContainer(args[0])
if err != nil {
- return errors.Wrapf(err, "error unmounting container %q", args[0])
+ return errors.Wrapf(err, "error looking up container %q", args[0])
}
- return nil
+
+ return ctr.Unmount()
}