Merge pull request #1100 from crosbymichael/update-task
Implement task update
This commit is contained in:
@@ -23,6 +23,7 @@ import (
|
||||
"github.com/containerd/containerd/plugin"
|
||||
"github.com/containerd/fifo"
|
||||
runc "github.com/containerd/go-runc"
|
||||
specs "github.com/opencontainers/runtime-spec/specs-go"
|
||||
"github.com/pkg/errors"
|
||||
)
|
||||
|
||||
@@ -284,6 +285,14 @@ func (p *initProcess) Checkpoint(context context.Context, r *shimapi.CheckpointT
|
||||
return nil
|
||||
}
|
||||
|
||||
func (p *initProcess) Update(context context.Context, r *shimapi.UpdateTaskRequest) error {
|
||||
var resources specs.LinuxResources
|
||||
if err := json.Unmarshal(r.Resources.Value, &resources); err != nil {
|
||||
return err
|
||||
}
|
||||
return p.runc.Update(context, p.id, &resources)
|
||||
}
|
||||
|
||||
// TODO(mlaventure): move to runc package?
|
||||
func getLastRuncError(r *runc.Runc) (string, error) {
|
||||
if r.Log == "" {
|
||||
|
Reference in New Issue
Block a user