Merge pull request #2425 from avagin/docker-fixes

task: allow to specify namespaces which are restored externally
This commit is contained in:
Michael Crosby 2018-07-25 10:26:08 -04:00 committed by GitHub
commit 26e2dd6754
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -78,12 +78,22 @@ func withExit(rt string) containerd.CheckpointTaskOpts {
return func(r *containerd.CheckpointTaskInfo) error {
switch rt {
case "io.containerd.runc.v1":
r.Options = &options.CheckpointOptions{
Exit: true,
if r.Options == nil {
r.Options = &options.CheckpointOptions{
Exit: true,
}
} else {
opts, _ := r.Options.(*options.CheckpointOptions)
opts.Exit = true
}
default:
r.Options = &runctypes.CheckpointOptions{
Exit: true,
if r.Options == nil {
r.Options = &runctypes.CheckpointOptions{
Exit: true,
}
} else {
opts, _ := r.Options.(*runctypes.CheckpointOptions)
opts.Exit = true
}
}
return nil