summaryrefslogtreecommitdiff
path: root/cmd/kpod/umount.go
diff options
context:
space:
mode:
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()
}