Skip to content

Commit 40b0088

Browse files
committed
loadFactory: remove
Signed-off-by: Kir Kolyshkin <[email protected]>
1 parent d1fca8e commit 40b0088

File tree

2 files changed

+5
-10
lines changed

2 files changed

+5
-10
lines changed

list.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,8 +121,7 @@ func getContainers(context *cli.Context) ([]containerState, error) {
121121
// Report other errors, including non-existent custom --root.
122122
return nil, err
123123
}
124-
125-
factory, err := loadFactory(context)
124+
factory, err := libcontainer.New(root)
126125
if err != nil {
127126
return nil, err
128127
}

utils_linux.go

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,20 +23,15 @@ import (
2323

2424
var errEmptyID = errors.New("container id cannot be empty")
2525

26-
// loadFactory returns the configured factory instance for execing containers.
27-
func loadFactory(context *cli.Context) (libcontainer.Factory, error) {
28-
root := context.GlobalString("root")
29-
return libcontainer.New(root)
30-
}
31-
3226
// getContainer returns the specified container instance by loading it from state
3327
// with the default factory.
3428
func getContainer(context *cli.Context) (libcontainer.Container, error) {
3529
id := context.Args().First()
3630
if id == "" {
3731
return nil, errEmptyID
3832
}
39-
factory, err := loadFactory(context)
33+
root := context.GlobalString("root")
34+
factory, err := libcontainer.New(root)
4035
if err != nil {
4136
return nil, err
4237
}
@@ -189,7 +184,8 @@ func createContainer(context *cli.Context, id string, spec *specs.Spec) (libcont
189184
return nil, err
190185
}
191186

192-
factory, err := loadFactory(context)
187+
root := context.GlobalString("root")
188+
factory, err := libcontainer.New(root)
193189
if err != nil {
194190
return nil, err
195191
}

0 commit comments

Comments
 (0)