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

View File

@@ -169,11 +169,7 @@ func newContainer(t *testing.T, config *configs.Config) (libcontainer.Container,
name := strings.ReplaceAll(t.Name(), "/", "_") + strconv.FormatInt(-int64(time.Now().Nanosecond()), 35)
root := t.TempDir()
f, err := libcontainer.New(root)
if err != nil {
return nil, err
}
return f.Create(name, config)
return libcontainer.Create(root, name, config)
}
// runContainer runs the container with the specific config and arguments