mirror of
https://github.com/opencontainers/runc.git
synced 2025-09-27 03:46:19 +08:00
startContainer: minor refactor
All three callers* of startContainer call revisePidFile and createSpec before calling it, so it makes sense to move those calls to inside of the startContainer, and drop the spec argument. * -- in fact restore does not call revisePidFile, but it should. Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
This commit is contained in:
@@ -395,7 +395,15 @@ const (
|
||||
CT_ACT_RESTORE
|
||||
)
|
||||
|
||||
func startContainer(context *cli.Context, spec *specs.Spec, action CtAct, criuOpts *libcontainer.CriuOpts) (int, error) {
|
||||
func startContainer(context *cli.Context, action CtAct, criuOpts *libcontainer.CriuOpts) (int, error) {
|
||||
if err := revisePidFile(context); err != nil {
|
||||
return -1, err
|
||||
}
|
||||
spec, err := setupSpec(context)
|
||||
if err != nil {
|
||||
return -1, err
|
||||
}
|
||||
|
||||
id := context.Args().First()
|
||||
if id == "" {
|
||||
return -1, errEmptyID
|
||||
|
Reference in New Issue
Block a user