cmd/ctr: create an image for checkpoint
This allows one to manage the checkpoints by using the `ctr image` command. The image is created with label "containerd.io/checkpoint". By default, it is not included in the output of `ctr images ls`. We can list the images by using the following command: $ ctr images ls labels.containerd.\"io/checkpoint\"==true Fixes #1026 Signed-off-by: Jacob Wen <jian.w.wen@oracle.com>
This commit is contained in:
committed by
Michael Crosby
parent
70b5668351
commit
abbec62620
@@ -57,6 +57,16 @@ var imagesListCommand = cli.Command{
|
||||
imageStore := client.ImageService()
|
||||
cs := client.ContentStore()
|
||||
|
||||
if len(filters) == 0 {
|
||||
filters = append(filters, `labels.containerd."io/checkpoint"!=true`)
|
||||
} else {
|
||||
for _, f := range filters {
|
||||
if !strings.Contains(f, `labels.containerd."io/checkpoint"`) {
|
||||
f += `,labels.containerd."io/checkpoint"!=true`
|
||||
_ = f // ignore error: ineffectual assignment to f
|
||||
}
|
||||
}
|
||||
}
|
||||
imageList, err := imageStore.List(ctx, filters...)
|
||||
if err != nil {
|
||||
return errors.Wrap(err, "failed to list images")
|
||||
|
||||
Reference in New Issue
Block a user