task: WithExit() doesn't have to overwrite existing options
Signed-off-by: Andrei Vagin <avagin@openvz.org>
This commit is contained in:
parent
394784b3aa
commit
fc2fcf6b2a
@ -78,13 +78,23 @@ func withExit(rt string) containerd.CheckpointTaskOpts {
|
||||
return func(r *containerd.CheckpointTaskInfo) error {
|
||||
switch rt {
|
||||
case "io.containerd.runc.v1":
|
||||
if r.Options == nil {
|
||||
r.Options = &options.CheckpointOptions{
|
||||
Exit: true,
|
||||
}
|
||||
} else {
|
||||
opts, _ := r.Options.(*options.CheckpointOptions)
|
||||
opts.Exit = true
|
||||
}
|
||||
default:
|
||||
if r.Options == nil {
|
||||
r.Options = &runctypes.CheckpointOptions{
|
||||
Exit: true,
|
||||
}
|
||||
} else {
|
||||
opts, _ := r.Options.(*runctypes.CheckpointOptions)
|
||||
opts.Exit = true
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user