Merge pull request #908 from ehazlett/fix-task-info

Updates the execution service to include ContainerID in tasks
This commit is contained in:
Stephen Day 2017-05-25 11:40:16 -07:00 committed by GitHub
commit 26183b3a69
5 changed files with 12 additions and 8 deletions

View File

@ -241,7 +241,7 @@ var runCommand = cli.Command{
}
}
createContainer, err := newCreateContainerRequest(context, id, id, spec)
createContainer, err := newCreateContainerRequest(context, id, id, ref, spec)
if err != nil {
return err
}

View File

@ -282,10 +282,11 @@ func newContainerSpec(context *cli.Context, config *ocispec.ImageConfig, imageRe
return json.Marshal(s)
}
func newCreateContainerRequest(context *cli.Context, id, snapshot string, spec []byte) (*containersapi.CreateContainerRequest, error) {
func newCreateContainerRequest(context *cli.Context, id, snapshot, image string, spec []byte) (*containersapi.CreateContainerRequest, error) {
create := &containersapi.CreateContainerRequest{
Container: containersapi.Container{
ID: id,
Image: image,
Spec: &protobuf.Any{
TypeUrl: specs.Version,
Value: spec,

View File

@ -139,10 +139,11 @@ func newContainerSpec(context *cli.Context, config *ocispec.ImageConfig, imageRe
return json.Marshal(rtSpec)
}
func newCreateContainerRequest(context *cli.Context, id, snapshot string, spec []byte) (*containersapi.CreateContainerRequest, error) {
func newCreateContainerRequest(context *cli.Context, id, snapshot, image string, spec []byte) (*containersapi.CreateContainerRequest, error) {
create := &containersapi.CreateContainerRequest{
Container: containersapi.Container{
ID: id,
Image: image,
Spec: &protobuf.Any{
TypeUrl: specs.Version,
Value: spec,

View File

@ -41,6 +41,7 @@ func newTask(id string, spec []byte, shim shim.ShimClient) *Task {
func (c *Task) Info() plugin.TaskInfo {
return plugin.TaskInfo{
ID: c.containerID,
ContainerID: c.containerID,
Runtime: runtimeName,
Spec: c.spec,

View File

@ -221,6 +221,7 @@ func taskFromContainerd(ctx context.Context, c plugin.Task) (*task.Task, error)
}
return &task.Task{
ID: c.Info().ID,
ContainerID: c.Info().ContainerID,
Pid: state.Pid(),
Status: status,
Spec: &protobuf.Any{