Create checkpointed image in client

Allow a user provided name for the checkpoint as well as a default
generated name for the checkpoint image.

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
This commit is contained in:
Michael Crosby
2017-10-17 12:05:11 -04:00
parent a19fd6ed6e
commit e201be5196
8 changed files with 73 additions and 59 deletions

View File

@@ -4,7 +4,6 @@ import (
"fmt"
"github.com/containerd/containerd"
"github.com/containerd/containerd/images"
"github.com/pkg/errors"
"github.com/urfave/cli"
)
@@ -49,20 +48,7 @@ var taskCheckpointCommand = cli.Command{
if err != nil {
return err
}
labels := map[string]string{
"containerd.io/checkpoint": "true",
}
img := images.Image{
Name: checkpoint.Digest.String(),
Target: checkpoint,
Labels: labels,
}
_, err = client.ImageService().Create(ctx, img)
if err != nil {
return err
}
fmt.Println(checkpoint.Digest.String())
fmt.Println(checkpoint.Name())
return nil
},
}