Skip to content

Commit b7c9774

Browse files
committed
container.Checkpoint(), WithRestoreImage(): use ocispec.AnnotationRefName
instead of a locally defined const Signed-off-by: Sebastiaan van Stijn <[email protected]>
1 parent 7cd7a5c commit b7c9774

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

client/container.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ import (
4242
)
4343

4444
const (
45-
checkpointImageNameLabel = "org.opencontainers.image.ref.name"
4645
checkpointRuntimeNameLabel = "io.containerd.checkpoint.runtime"
4746
checkpointSnapshotterNameLabel = "io.containerd.checkpoint.snapshotter"
4847
)
@@ -357,7 +356,7 @@ func (c *container) Checkpoint(ctx context.Context, ref string, opts ...Checkpoi
357356
defer done(ctx)
358357

359358
// add image name to manifest
360-
index.Annotations[checkpointImageNameLabel] = img.Name()
359+
index.Annotations[ocispec.AnnotationRefName] = img.Name()
361360
// add runtime info to index
362361
index.Annotations[checkpointRuntimeNameLabel] = info.Runtime.Name
363362
// add snapshotter info to index

client/container_restore_opts.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ type RestoreOpts func(context.Context, string, *Client, Image, *imagespec.Index)
4545
// WithRestoreImage restores the image for the container
4646
func WithRestoreImage(ctx context.Context, id string, client *Client, checkpoint Image, index *imagespec.Index) NewContainerOpts {
4747
return func(ctx context.Context, client *Client, c *containers.Container) error {
48-
name, ok := index.Annotations[checkpointImageNameLabel]
48+
name, ok := index.Annotations[imagespec.AnnotationRefName]
4949
if !ok || name == "" {
5050
return ErrImageNameNotFoundInIndex
5151
}

0 commit comments

Comments
 (0)