Merge pull request #1656 from crosbymichael/rev-name
Reverse checkpoint url
This commit is contained in:
commit
84fa3967c5
8
task.go
8
task.go
@ -36,6 +36,11 @@ import (
|
|||||||
// or if an error was encountered when obtaining the exit status, it is set to 255.
|
// or if an error was encountered when obtaining the exit status, it is set to 255.
|
||||||
const UnknownExitStatus = 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
|
// Status returns process status and exit information
|
||||||
type Status struct {
|
type Status struct {
|
||||||
// Status of the process
|
// Status of the process
|
||||||
@ -362,10 +367,9 @@ func (t *task) Checkpoint(ctx context.Context, opts ...CheckpointTaskOpts) (Imag
|
|||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
const checkpointDateFormat = "01-02-2006-15:04:05"
|
|
||||||
// set a default name
|
// set a default name
|
||||||
if i.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
|
request.ParentCheckpoint = i.ParentCheckpoint
|
||||||
if i.Options != nil {
|
if i.Options != nil {
|
||||||
|
Loading…
Reference in New Issue
Block a user