From 21c992a9c84983e51d2a265027632fcd78b350cb Mon Sep 17 00:00:00 2001 From: Michael Crosby Date: Wed, 18 Oct 2017 14:58:28 -0400 Subject: [PATCH] Reverse checkpoint url Signed-off-by: Michael Crosby --- task.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/task.go b/task.go index 8329a0b7f..6b9af1d41 100644 --- a/task.go +++ b/task.go @@ -36,6 +36,11 @@ import ( // or if an error was encountered when obtaining the exit status, it is set to 255. const UnknownExitStatus = 255 +const ( + checkpointDateFormat = "01-02-2006-15:04:05" + checkpointNameFormat = "containerd.io/checkpoint/%s:%s" +) + // Status returns process status and exit information type Status struct { // Status of the process @@ -362,10 +367,9 @@ func (t *task) Checkpoint(ctx context.Context, opts ...CheckpointTaskOpts) (Imag return nil, err } } - const checkpointDateFormat = "01-02-2006-15:04:05" // set a default name if i.Name == "" { - i.Name = fmt.Sprintf("io.containerd/checkpoint/%s:%s", t.id, time.Now().Format(checkpointDateFormat)) + i.Name = fmt.Sprintf(checkpointNameFormat, t.id, time.Now().Format(checkpointDateFormat)) } request.ParentCheckpoint = i.ParentCheckpoint if i.Options != nil {