Implement options for runtime specific settings

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
This commit is contained in:
Michael Crosby
2017-06-23 14:55:10 -07:00
parent eedcbc64cc
commit 82d0208aaa
18 changed files with 1701 additions and 467 deletions

View File

@@ -121,7 +121,10 @@ func (s *Service) Create(ctx context.Context, r *api.CreateTaskRequest) (*api.Cr
if err != nil {
return nil, errdefs.ToGRPC(err)
}
var options []byte
if r.Options != nil {
options = r.Options.Value
}
opts := runtime.CreateOpts{
Spec: container.Spec,
IO: runtime.IO{
@@ -131,6 +134,7 @@ func (s *Service) Create(ctx context.Context, r *api.CreateTaskRequest) (*api.Cr
Terminal: r.Terminal,
},
Checkpoint: checkpointPath,
Options: options,
}
for _, m := range r.Rootfs {
opts.Rootfs = append(opts.Rootfs, mount.Mount{
@@ -414,7 +418,11 @@ func (s *Service) Checkpoint(ctx context.Context, r *api.CheckpointTaskRequest)
return nil, err
}
defer os.RemoveAll(image)
if err := t.Checkpoint(ctx, image, r.Options); err != nil {
var options []byte
if r.Options != nil {
options = r.Options.Value
}
if err := t.Checkpoint(ctx, image, options); err != nil {
return nil, err
}
// write checkpoint to the content store