checkpoint: add copts to checkpoint; save snapshotter to annotation

Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>
This commit is contained in:
Evan Hazlett
2018-09-25 15:05:37 +00:00
parent 40caece8dc
commit 6f2f4e4343
6 changed files with 55 additions and 46 deletions

View File

@@ -39,8 +39,9 @@ import (
)
const (
checkpointImageNameLabel = "image.name"
checkpointRuntimeNameLabel = "runtime.name"
checkpointImageNameLabel = "org.opencontainers.image.ref.name"
checkpointRuntimeNameLabel = "io.containerd.checkpoint.runtime"
checkpointSnapshotterNameLabel = "io.containerd.checkpoint.snapshotter"
)
// Container is a metadata object for container resources and task creation
@@ -318,6 +319,8 @@ func (c *container) Checkpoint(ctx context.Context, ref string, opts ...Checkpoi
index.Annotations[checkpointImageNameLabel] = img.Name()
// add runtime info to index
index.Annotations[checkpointRuntimeNameLabel] = info.Runtime.Name
// add snapshotter info to index
index.Annotations[checkpointSnapshotterNameLabel] = info.Snapshotter
// process remaining opts
for _, o := range opts {