libcontainer: remove LinuxFactory

Since LinuxFactory has become the means to specify containers state
top directory (aka --root), and is only used by two methods (Create
and Load), it is easier to pass root to them directly.

Modify all the users and the docs accordingly.

While at it, fix Create and Load docs (those that were originally moved
from the Factory interface docs).

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
This commit is contained in:
Kir Kolyshkin
2022-02-10 19:53:38 -08:00
parent 6a29787bc9
commit 6a3fe1618f
9 changed files with 44 additions and 106 deletions
+1 -6
View File
@@ -121,11 +121,6 @@ func getContainers(context *cli.Context) ([]containerState, error) {
// Report other errors, including non-existent custom --root.
return nil, err
}
factory, err := libcontainer.New(root)
if err != nil {
return nil, err
}
var s []containerState
for _, item := range list {
if !item.IsDir() {
@@ -146,7 +141,7 @@ func getContainers(context *cli.Context) ([]containerState, error) {
owner.Name = fmt.Sprintf("#%d", uid)
}
container, err := factory.Load(item.Name())
container, err := libcontainer.Load(root, item.Name())
if err != nil {
fmt.Fprintf(os.Stderr, "load container %s: %v\n", item.Name(), err)
continue