updates the execution service to include ContainerID in tasks
Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>
This commit is contained in:
parent
5157a326fd
commit
f42c762dc4
@ -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 {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
@ -282,10 +282,11 @@ func newContainerSpec(context *cli.Context, config *ocispec.ImageConfig, imageRe
|
|||||||
return json.Marshal(s)
|
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{
|
create := &containersapi.CreateContainerRequest{
|
||||||
Container: containersapi.Container{
|
Container: containersapi.Container{
|
||||||
ID: id,
|
ID: id,
|
||||||
|
Image: image,
|
||||||
Spec: &protobuf.Any{
|
Spec: &protobuf.Any{
|
||||||
TypeUrl: specs.Version,
|
TypeUrl: specs.Version,
|
||||||
Value: spec,
|
Value: spec,
|
||||||
|
@ -139,10 +139,11 @@ func newContainerSpec(context *cli.Context, config *ocispec.ImageConfig, imageRe
|
|||||||
return json.Marshal(rtSpec)
|
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{
|
create := &containersapi.CreateContainerRequest{
|
||||||
Container: containersapi.Container{
|
Container: containersapi.Container{
|
||||||
ID: id,
|
ID: id,
|
||||||
|
Image: image,
|
||||||
Spec: &protobuf.Any{
|
Spec: &protobuf.Any{
|
||||||
TypeUrl: specs.Version,
|
TypeUrl: specs.Version,
|
||||||
Value: spec,
|
Value: spec,
|
||||||
|
@ -41,6 +41,7 @@ func newTask(id string, spec []byte, shim shim.ShimClient) *Task {
|
|||||||
|
|
||||||
func (c *Task) Info() plugin.TaskInfo {
|
func (c *Task) Info() plugin.TaskInfo {
|
||||||
return plugin.TaskInfo{
|
return plugin.TaskInfo{
|
||||||
|
ID: c.containerID,
|
||||||
ContainerID: c.containerID,
|
ContainerID: c.containerID,
|
||||||
Runtime: runtimeName,
|
Runtime: runtimeName,
|
||||||
Spec: c.spec,
|
Spec: c.spec,
|
||||||
|
@ -220,9 +220,10 @@ func taskFromContainerd(ctx context.Context, c plugin.Task) (*task.Task, error)
|
|||||||
log.G(ctx).WithField("status", state.Status()).Warn("unknown status")
|
log.G(ctx).WithField("status", state.Status()).Warn("unknown status")
|
||||||
}
|
}
|
||||||
return &task.Task{
|
return &task.Task{
|
||||||
ID: c.Info().ID,
|
ID: c.Info().ID,
|
||||||
Pid: state.Pid(),
|
ContainerID: c.Info().ContainerID,
|
||||||
Status: status,
|
Pid: state.Pid(),
|
||||||
|
Status: status,
|
||||||
Spec: &protobuf.Any{
|
Spec: &protobuf.Any{
|
||||||
TypeUrl: specs.Version,
|
TypeUrl: specs.Version,
|
||||||
Value: c.Info().Spec,
|
Value: c.Info().Spec,
|
||||||
|
Loading…
Reference in New Issue
Block a user