mirror of
https://github.com/opencontainers/runc.git
synced 2026-07-10 21:53:57 +08:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user