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:
Kir Kolyshkin
2021-09-14 10:46:48 -07:00
parent 1545ea69b7
commit 9ba2f65d6b
4 changed files with 12 additions and 22 deletions
+1 -5
View File
@@ -104,15 +104,11 @@ using the runc checkpoint command.`,
logrus.Warn("runc checkpoint is untested with rootless containers")
}
spec, err := setupSpec(context)
if err != nil {
return err
}
options := criuOptions(context)
if err := setEmptyNsMask(context, options); err != nil {
return err
}
status, err := startContainer(context, spec, CT_ACT_RESTORE, options)
status, err := startContainer(context, CT_ACT_RESTORE, options)
if err != nil {
return err
}