diff --git a/list.go b/list.go index 3fb991724..5aa9bebdd 100644 --- a/list.go +++ b/list.go @@ -5,7 +5,6 @@ import ( "errors" "fmt" "os" - "path/filepath" "syscall" "text/tabwriter" "time" @@ -116,11 +115,7 @@ func getContainers(context *cli.Context) ([]containerState, error) { return nil, err } root := context.GlobalString("root") - absRoot, err := filepath.Abs(root) - if err != nil { - return nil, err - } - list, err := os.ReadDir(absRoot) + list, err := os.ReadDir(root) if err != nil { fatal(err) } diff --git a/utils_linux.go b/utils_linux.go index c2214a233..e0d1cae74 100644 --- a/utils_linux.go +++ b/utils_linux.go @@ -26,12 +26,7 @@ var errEmptyID = errors.New("container id cannot be empty") // loadFactory returns the configured factory instance for execing containers. func loadFactory(context *cli.Context) (libcontainer.Factory, error) { root := context.GlobalString("root") - abs, err := filepath.Abs(root) - if err != nil { - return nil, err - } - - return libcontainer.New(abs) + return libcontainer.New(root) } // getContainer returns the specified container instance by loading it from state