From facfce3e8e436d863a45f9e972ede1c77ec48653 Mon Sep 17 00:00:00 2001 From: Burcu Dogan Date: Mon, 25 Jan 2016 19:36:17 -0800 Subject: [PATCH] ctr: convert bundle paths to absolute Fixes #75. Signed-off-by: Burcu Dogan --- ctr/container.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/ctr/container.go b/ctr/container.go index b6f9b44..af793c4 100644 --- a/ctr/container.go +++ b/ctr/container.go @@ -96,6 +96,10 @@ var startCommand = cli.Command{ if id == "" { fatal("container id cannot be empty", 1) } + bpath, err := filepath.Abs(path) + if err != nil { + fatal(fmt.Sprintf("cannot get the absolute path of the bundle: %v", err), 1) + } c := getClient(context) events, err := c.Events(netcontext.Background(), &types.EventsRequest{}) if err != nil { @@ -103,11 +107,11 @@ var startCommand = cli.Command{ } r := &types.CreateContainerRequest{ Id: id, - BundlePath: path, + BundlePath: bpath, Checkpoint: context.String("checkpoint"), } if context.Bool("attach") { - mkterm, err := readTermSetting(path) + mkterm, err := readTermSetting(bpath) if err != nil { fatal(err.Error(), 1) }