Add ability to signal container not just processes
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
This commit is contained in:
parent
9eb08b8971
commit
b5931855a4
5 changed files with 24 additions and 1 deletions
|
@ -225,7 +225,14 @@ func (c *libcontainerContainer) getCheckpointPath(name string) string {
|
|||
|
||||
func (c *libcontainerContainer) Checkpoint(cp runtime.Checkpoint) error {
|
||||
opts := c.createCheckpointOpts(cp)
|
||||
if err := os.MkdirAll(opts.ImagesDirectory, 0755); err != nil {
|
||||
if err := os.MkdirAll(filepath.Dir(opts.ImagesDirectory), 0755); err != nil {
|
||||
return err
|
||||
}
|
||||
// mkdir is atomic so if it already exists we can fail
|
||||
if err := os.Mkdir(opts.ImagesDirectory, 0755); err != nil {
|
||||
if os.IsExist(err) {
|
||||
return runtime.ErrCheckpointExists
|
||||
}
|
||||
return err
|
||||
}
|
||||
if err := c.c.Checkpoint(opts); err != nil {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue