Add Get of task and process state
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
This commit is contained in:
parent
2974e485f3
commit
504033e373
@ -16,8 +16,8 @@
|
|||||||
DeleteTaskRequest
|
DeleteTaskRequest
|
||||||
DeleteResponse
|
DeleteResponse
|
||||||
DeleteProcessRequest
|
DeleteProcessRequest
|
||||||
GetTaskRequest
|
GetRequest
|
||||||
GetTaskResponse
|
GetResponse
|
||||||
ListTasksRequest
|
ListTasksRequest
|
||||||
ListTasksResponse
|
ListTasksResponse
|
||||||
KillRequest
|
KillRequest
|
||||||
@ -148,21 +148,22 @@ func (m *DeleteProcessRequest) Reset() { *m = DeleteProcessRe
|
|||||||
func (*DeleteProcessRequest) ProtoMessage() {}
|
func (*DeleteProcessRequest) ProtoMessage() {}
|
||||||
func (*DeleteProcessRequest) Descriptor() ([]byte, []int) { return fileDescriptorTasks, []int{6} }
|
func (*DeleteProcessRequest) Descriptor() ([]byte, []int) { return fileDescriptorTasks, []int{6} }
|
||||||
|
|
||||||
type GetTaskRequest struct {
|
type GetRequest struct {
|
||||||
ContainerID string `protobuf:"bytes,1,opt,name=container_id,json=containerId,proto3" json:"container_id,omitempty"`
|
ContainerID string `protobuf:"bytes,1,opt,name=container_id,json=containerId,proto3" json:"container_id,omitempty"`
|
||||||
|
ExecID string `protobuf:"bytes,2,opt,name=exec_id,json=execId,proto3" json:"exec_id,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *GetTaskRequest) Reset() { *m = GetTaskRequest{} }
|
func (m *GetRequest) Reset() { *m = GetRequest{} }
|
||||||
func (*GetTaskRequest) ProtoMessage() {}
|
func (*GetRequest) ProtoMessage() {}
|
||||||
func (*GetTaskRequest) Descriptor() ([]byte, []int) { return fileDescriptorTasks, []int{7} }
|
func (*GetRequest) Descriptor() ([]byte, []int) { return fileDescriptorTasks, []int{7} }
|
||||||
|
|
||||||
type GetTaskResponse struct {
|
type GetResponse struct {
|
||||||
Task *containerd_v1_types.Task `protobuf:"bytes,1,opt,name=task" json:"task,omitempty"`
|
Process *containerd_v1_types.Process `protobuf:"bytes,1,opt,name=process" json:"process,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *GetTaskResponse) Reset() { *m = GetTaskResponse{} }
|
func (m *GetResponse) Reset() { *m = GetResponse{} }
|
||||||
func (*GetTaskResponse) ProtoMessage() {}
|
func (*GetResponse) ProtoMessage() {}
|
||||||
func (*GetTaskResponse) Descriptor() ([]byte, []int) { return fileDescriptorTasks, []int{8} }
|
func (*GetResponse) Descriptor() ([]byte, []int) { return fileDescriptorTasks, []int{8} }
|
||||||
|
|
||||||
type ListTasksRequest struct {
|
type ListTasksRequest struct {
|
||||||
Filter string `protobuf:"bytes,1,opt,name=filter,proto3" json:"filter,omitempty"`
|
Filter string `protobuf:"bytes,1,opt,name=filter,proto3" json:"filter,omitempty"`
|
||||||
@ -173,7 +174,7 @@ func (*ListTasksRequest) ProtoMessage() {}
|
|||||||
func (*ListTasksRequest) Descriptor() ([]byte, []int) { return fileDescriptorTasks, []int{9} }
|
func (*ListTasksRequest) Descriptor() ([]byte, []int) { return fileDescriptorTasks, []int{9} }
|
||||||
|
|
||||||
type ListTasksResponse struct {
|
type ListTasksResponse struct {
|
||||||
Tasks []*containerd_v1_types.Task `protobuf:"bytes,1,rep,name=tasks" json:"tasks,omitempty"`
|
Tasks []*containerd_v1_types.Process `protobuf:"bytes,1,rep,name=tasks" json:"tasks,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *ListTasksResponse) Reset() { *m = ListTasksResponse{} }
|
func (m *ListTasksResponse) Reset() { *m = ListTasksResponse{} }
|
||||||
@ -304,8 +305,8 @@ func init() {
|
|||||||
proto.RegisterType((*DeleteTaskRequest)(nil), "containerd.services.tasks.v1.DeleteTaskRequest")
|
proto.RegisterType((*DeleteTaskRequest)(nil), "containerd.services.tasks.v1.DeleteTaskRequest")
|
||||||
proto.RegisterType((*DeleteResponse)(nil), "containerd.services.tasks.v1.DeleteResponse")
|
proto.RegisterType((*DeleteResponse)(nil), "containerd.services.tasks.v1.DeleteResponse")
|
||||||
proto.RegisterType((*DeleteProcessRequest)(nil), "containerd.services.tasks.v1.DeleteProcessRequest")
|
proto.RegisterType((*DeleteProcessRequest)(nil), "containerd.services.tasks.v1.DeleteProcessRequest")
|
||||||
proto.RegisterType((*GetTaskRequest)(nil), "containerd.services.tasks.v1.GetTaskRequest")
|
proto.RegisterType((*GetRequest)(nil), "containerd.services.tasks.v1.GetRequest")
|
||||||
proto.RegisterType((*GetTaskResponse)(nil), "containerd.services.tasks.v1.GetTaskResponse")
|
proto.RegisterType((*GetResponse)(nil), "containerd.services.tasks.v1.GetResponse")
|
||||||
proto.RegisterType((*ListTasksRequest)(nil), "containerd.services.tasks.v1.ListTasksRequest")
|
proto.RegisterType((*ListTasksRequest)(nil), "containerd.services.tasks.v1.ListTasksRequest")
|
||||||
proto.RegisterType((*ListTasksResponse)(nil), "containerd.services.tasks.v1.ListTasksResponse")
|
proto.RegisterType((*ListTasksResponse)(nil), "containerd.services.tasks.v1.ListTasksResponse")
|
||||||
proto.RegisterType((*KillRequest)(nil), "containerd.services.tasks.v1.KillRequest")
|
proto.RegisterType((*KillRequest)(nil), "containerd.services.tasks.v1.KillRequest")
|
||||||
@ -340,7 +341,7 @@ type TasksClient interface {
|
|||||||
// Delete a task and on disk state.
|
// Delete a task and on disk state.
|
||||||
Delete(ctx context.Context, in *DeleteTaskRequest, opts ...grpc.CallOption) (*DeleteResponse, error)
|
Delete(ctx context.Context, in *DeleteTaskRequest, opts ...grpc.CallOption) (*DeleteResponse, error)
|
||||||
DeleteProcess(ctx context.Context, in *DeleteProcessRequest, opts ...grpc.CallOption) (*DeleteResponse, error)
|
DeleteProcess(ctx context.Context, in *DeleteProcessRequest, opts ...grpc.CallOption) (*DeleteResponse, error)
|
||||||
Get(ctx context.Context, in *GetTaskRequest, opts ...grpc.CallOption) (*GetTaskResponse, error)
|
Get(ctx context.Context, in *GetRequest, opts ...grpc.CallOption) (*GetResponse, error)
|
||||||
List(ctx context.Context, in *ListTasksRequest, opts ...grpc.CallOption) (*ListTasksResponse, error)
|
List(ctx context.Context, in *ListTasksRequest, opts ...grpc.CallOption) (*ListTasksResponse, error)
|
||||||
// Kill a task or process.
|
// Kill a task or process.
|
||||||
Kill(ctx context.Context, in *KillRequest, opts ...grpc.CallOption) (*google_protobuf.Empty, error)
|
Kill(ctx context.Context, in *KillRequest, opts ...grpc.CallOption) (*google_protobuf.Empty, error)
|
||||||
@ -398,8 +399,8 @@ func (c *tasksClient) DeleteProcess(ctx context.Context, in *DeleteProcessReques
|
|||||||
return out, nil
|
return out, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *tasksClient) Get(ctx context.Context, in *GetTaskRequest, opts ...grpc.CallOption) (*GetTaskResponse, error) {
|
func (c *tasksClient) Get(ctx context.Context, in *GetRequest, opts ...grpc.CallOption) (*GetResponse, error) {
|
||||||
out := new(GetTaskResponse)
|
out := new(GetResponse)
|
||||||
err := grpc.Invoke(ctx, "/containerd.services.tasks.v1.Tasks/Get", in, out, c.cc, opts...)
|
err := grpc.Invoke(ctx, "/containerd.services.tasks.v1.Tasks/Get", in, out, c.cc, opts...)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
@ -507,7 +508,7 @@ type TasksServer interface {
|
|||||||
// Delete a task and on disk state.
|
// Delete a task and on disk state.
|
||||||
Delete(context.Context, *DeleteTaskRequest) (*DeleteResponse, error)
|
Delete(context.Context, *DeleteTaskRequest) (*DeleteResponse, error)
|
||||||
DeleteProcess(context.Context, *DeleteProcessRequest) (*DeleteResponse, error)
|
DeleteProcess(context.Context, *DeleteProcessRequest) (*DeleteResponse, error)
|
||||||
Get(context.Context, *GetTaskRequest) (*GetTaskResponse, error)
|
Get(context.Context, *GetRequest) (*GetResponse, error)
|
||||||
List(context.Context, *ListTasksRequest) (*ListTasksResponse, error)
|
List(context.Context, *ListTasksRequest) (*ListTasksResponse, error)
|
||||||
// Kill a task or process.
|
// Kill a task or process.
|
||||||
Kill(context.Context, *KillRequest) (*google_protobuf.Empty, error)
|
Kill(context.Context, *KillRequest) (*google_protobuf.Empty, error)
|
||||||
@ -598,7 +599,7 @@ func _Tasks_DeleteProcess_Handler(srv interface{}, ctx context.Context, dec func
|
|||||||
}
|
}
|
||||||
|
|
||||||
func _Tasks_Get_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
func _Tasks_Get_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||||
in := new(GetTaskRequest)
|
in := new(GetRequest)
|
||||||
if err := dec(in); err != nil {
|
if err := dec(in); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
@ -610,7 +611,7 @@ func _Tasks_Get_Handler(srv interface{}, ctx context.Context, dec func(interface
|
|||||||
FullMethod: "/containerd.services.tasks.v1.Tasks/Get",
|
FullMethod: "/containerd.services.tasks.v1.Tasks/Get",
|
||||||
}
|
}
|
||||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||||
return srv.(TasksServer).Get(ctx, req.(*GetTaskRequest))
|
return srv.(TasksServer).Get(ctx, req.(*GetRequest))
|
||||||
}
|
}
|
||||||
return interceptor(ctx, in, info, handler)
|
return interceptor(ctx, in, info, handler)
|
||||||
}
|
}
|
||||||
@ -1126,7 +1127,7 @@ func (m *DeleteProcessRequest) MarshalTo(dAtA []byte) (int, error) {
|
|||||||
return i, nil
|
return i, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *GetTaskRequest) Marshal() (dAtA []byte, err error) {
|
func (m *GetRequest) Marshal() (dAtA []byte, err error) {
|
||||||
size := m.Size()
|
size := m.Size()
|
||||||
dAtA = make([]byte, size)
|
dAtA = make([]byte, size)
|
||||||
n, err := m.MarshalTo(dAtA)
|
n, err := m.MarshalTo(dAtA)
|
||||||
@ -1136,7 +1137,7 @@ func (m *GetTaskRequest) Marshal() (dAtA []byte, err error) {
|
|||||||
return dAtA[:n], nil
|
return dAtA[:n], nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *GetTaskRequest) MarshalTo(dAtA []byte) (int, error) {
|
func (m *GetRequest) MarshalTo(dAtA []byte) (int, error) {
|
||||||
var i int
|
var i int
|
||||||
_ = i
|
_ = i
|
||||||
var l int
|
var l int
|
||||||
@ -1147,10 +1148,16 @@ func (m *GetTaskRequest) MarshalTo(dAtA []byte) (int, error) {
|
|||||||
i = encodeVarintTasks(dAtA, i, uint64(len(m.ContainerID)))
|
i = encodeVarintTasks(dAtA, i, uint64(len(m.ContainerID)))
|
||||||
i += copy(dAtA[i:], m.ContainerID)
|
i += copy(dAtA[i:], m.ContainerID)
|
||||||
}
|
}
|
||||||
|
if len(m.ExecID) > 0 {
|
||||||
|
dAtA[i] = 0x12
|
||||||
|
i++
|
||||||
|
i = encodeVarintTasks(dAtA, i, uint64(len(m.ExecID)))
|
||||||
|
i += copy(dAtA[i:], m.ExecID)
|
||||||
|
}
|
||||||
return i, nil
|
return i, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *GetTaskResponse) Marshal() (dAtA []byte, err error) {
|
func (m *GetResponse) Marshal() (dAtA []byte, err error) {
|
||||||
size := m.Size()
|
size := m.Size()
|
||||||
dAtA = make([]byte, size)
|
dAtA = make([]byte, size)
|
||||||
n, err := m.MarshalTo(dAtA)
|
n, err := m.MarshalTo(dAtA)
|
||||||
@ -1160,16 +1167,16 @@ func (m *GetTaskResponse) Marshal() (dAtA []byte, err error) {
|
|||||||
return dAtA[:n], nil
|
return dAtA[:n], nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *GetTaskResponse) MarshalTo(dAtA []byte) (int, error) {
|
func (m *GetResponse) MarshalTo(dAtA []byte) (int, error) {
|
||||||
var i int
|
var i int
|
||||||
_ = i
|
_ = i
|
||||||
var l int
|
var l int
|
||||||
_ = l
|
_ = l
|
||||||
if m.Task != nil {
|
if m.Process != nil {
|
||||||
dAtA[i] = 0xa
|
dAtA[i] = 0xa
|
||||||
i++
|
i++
|
||||||
i = encodeVarintTasks(dAtA, i, uint64(m.Task.Size()))
|
i = encodeVarintTasks(dAtA, i, uint64(m.Process.Size()))
|
||||||
n4, err := m.Task.MarshalTo(dAtA[i:])
|
n4, err := m.Process.MarshalTo(dAtA[i:])
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return 0, err
|
return 0, err
|
||||||
}
|
}
|
||||||
@ -1798,21 +1805,25 @@ func (m *DeleteProcessRequest) Size() (n int) {
|
|||||||
return n
|
return n
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *GetTaskRequest) Size() (n int) {
|
func (m *GetRequest) Size() (n int) {
|
||||||
var l int
|
var l int
|
||||||
_ = l
|
_ = l
|
||||||
l = len(m.ContainerID)
|
l = len(m.ContainerID)
|
||||||
if l > 0 {
|
if l > 0 {
|
||||||
n += 1 + l + sovTasks(uint64(l))
|
n += 1 + l + sovTasks(uint64(l))
|
||||||
}
|
}
|
||||||
|
l = len(m.ExecID)
|
||||||
|
if l > 0 {
|
||||||
|
n += 1 + l + sovTasks(uint64(l))
|
||||||
|
}
|
||||||
return n
|
return n
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *GetTaskResponse) Size() (n int) {
|
func (m *GetResponse) Size() (n int) {
|
||||||
var l int
|
var l int
|
||||||
_ = l
|
_ = l
|
||||||
if m.Task != nil {
|
if m.Process != nil {
|
||||||
l = m.Task.Size()
|
l = m.Process.Size()
|
||||||
n += 1 + l + sovTasks(uint64(l))
|
n += 1 + l + sovTasks(uint64(l))
|
||||||
}
|
}
|
||||||
return n
|
return n
|
||||||
@ -2119,22 +2130,23 @@ func (this *DeleteProcessRequest) String() string {
|
|||||||
}, "")
|
}, "")
|
||||||
return s
|
return s
|
||||||
}
|
}
|
||||||
func (this *GetTaskRequest) String() string {
|
func (this *GetRequest) String() string {
|
||||||
if this == nil {
|
if this == nil {
|
||||||
return "nil"
|
return "nil"
|
||||||
}
|
}
|
||||||
s := strings.Join([]string{`&GetTaskRequest{`,
|
s := strings.Join([]string{`&GetRequest{`,
|
||||||
`ContainerID:` + fmt.Sprintf("%v", this.ContainerID) + `,`,
|
`ContainerID:` + fmt.Sprintf("%v", this.ContainerID) + `,`,
|
||||||
|
`ExecID:` + fmt.Sprintf("%v", this.ExecID) + `,`,
|
||||||
`}`,
|
`}`,
|
||||||
}, "")
|
}, "")
|
||||||
return s
|
return s
|
||||||
}
|
}
|
||||||
func (this *GetTaskResponse) String() string {
|
func (this *GetResponse) String() string {
|
||||||
if this == nil {
|
if this == nil {
|
||||||
return "nil"
|
return "nil"
|
||||||
}
|
}
|
||||||
s := strings.Join([]string{`&GetTaskResponse{`,
|
s := strings.Join([]string{`&GetResponse{`,
|
||||||
`Task:` + strings.Replace(fmt.Sprintf("%v", this.Task), "Task", "containerd_v1_types.Task", 1) + `,`,
|
`Process:` + strings.Replace(fmt.Sprintf("%v", this.Process), "Process", "containerd_v1_types.Process", 1) + `,`,
|
||||||
`}`,
|
`}`,
|
||||||
}, "")
|
}, "")
|
||||||
return s
|
return s
|
||||||
@ -2154,7 +2166,7 @@ func (this *ListTasksResponse) String() string {
|
|||||||
return "nil"
|
return "nil"
|
||||||
}
|
}
|
||||||
s := strings.Join([]string{`&ListTasksResponse{`,
|
s := strings.Join([]string{`&ListTasksResponse{`,
|
||||||
`Tasks:` + strings.Replace(fmt.Sprintf("%v", this.Tasks), "Task", "containerd_v1_types.Task", 1) + `,`,
|
`Tasks:` + strings.Replace(fmt.Sprintf("%v", this.Tasks), "Process", "containerd_v1_types.Process", 1) + `,`,
|
||||||
`}`,
|
`}`,
|
||||||
}, "")
|
}, "")
|
||||||
return s
|
return s
|
||||||
@ -3195,7 +3207,7 @@ func (m *DeleteProcessRequest) Unmarshal(dAtA []byte) error {
|
|||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
func (m *GetTaskRequest) Unmarshal(dAtA []byte) error {
|
func (m *GetRequest) Unmarshal(dAtA []byte) error {
|
||||||
l := len(dAtA)
|
l := len(dAtA)
|
||||||
iNdEx := 0
|
iNdEx := 0
|
||||||
for iNdEx < l {
|
for iNdEx < l {
|
||||||
@ -3218,10 +3230,10 @@ func (m *GetTaskRequest) Unmarshal(dAtA []byte) error {
|
|||||||
fieldNum := int32(wire >> 3)
|
fieldNum := int32(wire >> 3)
|
||||||
wireType := int(wire & 0x7)
|
wireType := int(wire & 0x7)
|
||||||
if wireType == 4 {
|
if wireType == 4 {
|
||||||
return fmt.Errorf("proto: GetTaskRequest: wiretype end group for non-group")
|
return fmt.Errorf("proto: GetRequest: wiretype end group for non-group")
|
||||||
}
|
}
|
||||||
if fieldNum <= 0 {
|
if fieldNum <= 0 {
|
||||||
return fmt.Errorf("proto: GetTaskRequest: illegal tag %d (wire type %d)", fieldNum, wire)
|
return fmt.Errorf("proto: GetRequest: illegal tag %d (wire type %d)", fieldNum, wire)
|
||||||
}
|
}
|
||||||
switch fieldNum {
|
switch fieldNum {
|
||||||
case 1:
|
case 1:
|
||||||
@ -3253,6 +3265,35 @@ func (m *GetTaskRequest) Unmarshal(dAtA []byte) error {
|
|||||||
}
|
}
|
||||||
m.ContainerID = string(dAtA[iNdEx:postIndex])
|
m.ContainerID = string(dAtA[iNdEx:postIndex])
|
||||||
iNdEx = postIndex
|
iNdEx = postIndex
|
||||||
|
case 2:
|
||||||
|
if wireType != 2 {
|
||||||
|
return fmt.Errorf("proto: wrong wireType = %d for field ExecID", wireType)
|
||||||
|
}
|
||||||
|
var stringLen uint64
|
||||||
|
for shift := uint(0); ; shift += 7 {
|
||||||
|
if shift >= 64 {
|
||||||
|
return ErrIntOverflowTasks
|
||||||
|
}
|
||||||
|
if iNdEx >= l {
|
||||||
|
return io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
b := dAtA[iNdEx]
|
||||||
|
iNdEx++
|
||||||
|
stringLen |= (uint64(b) & 0x7F) << shift
|
||||||
|
if b < 0x80 {
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
intStringLen := int(stringLen)
|
||||||
|
if intStringLen < 0 {
|
||||||
|
return ErrInvalidLengthTasks
|
||||||
|
}
|
||||||
|
postIndex := iNdEx + intStringLen
|
||||||
|
if postIndex > l {
|
||||||
|
return io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
m.ExecID = string(dAtA[iNdEx:postIndex])
|
||||||
|
iNdEx = postIndex
|
||||||
default:
|
default:
|
||||||
iNdEx = preIndex
|
iNdEx = preIndex
|
||||||
skippy, err := skipTasks(dAtA[iNdEx:])
|
skippy, err := skipTasks(dAtA[iNdEx:])
|
||||||
@ -3274,7 +3315,7 @@ func (m *GetTaskRequest) Unmarshal(dAtA []byte) error {
|
|||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
func (m *GetTaskResponse) Unmarshal(dAtA []byte) error {
|
func (m *GetResponse) Unmarshal(dAtA []byte) error {
|
||||||
l := len(dAtA)
|
l := len(dAtA)
|
||||||
iNdEx := 0
|
iNdEx := 0
|
||||||
for iNdEx < l {
|
for iNdEx < l {
|
||||||
@ -3297,15 +3338,15 @@ func (m *GetTaskResponse) Unmarshal(dAtA []byte) error {
|
|||||||
fieldNum := int32(wire >> 3)
|
fieldNum := int32(wire >> 3)
|
||||||
wireType := int(wire & 0x7)
|
wireType := int(wire & 0x7)
|
||||||
if wireType == 4 {
|
if wireType == 4 {
|
||||||
return fmt.Errorf("proto: GetTaskResponse: wiretype end group for non-group")
|
return fmt.Errorf("proto: GetResponse: wiretype end group for non-group")
|
||||||
}
|
}
|
||||||
if fieldNum <= 0 {
|
if fieldNum <= 0 {
|
||||||
return fmt.Errorf("proto: GetTaskResponse: illegal tag %d (wire type %d)", fieldNum, wire)
|
return fmt.Errorf("proto: GetResponse: illegal tag %d (wire type %d)", fieldNum, wire)
|
||||||
}
|
}
|
||||||
switch fieldNum {
|
switch fieldNum {
|
||||||
case 1:
|
case 1:
|
||||||
if wireType != 2 {
|
if wireType != 2 {
|
||||||
return fmt.Errorf("proto: wrong wireType = %d for field Task", wireType)
|
return fmt.Errorf("proto: wrong wireType = %d for field Process", wireType)
|
||||||
}
|
}
|
||||||
var msglen int
|
var msglen int
|
||||||
for shift := uint(0); ; shift += 7 {
|
for shift := uint(0); ; shift += 7 {
|
||||||
@ -3329,10 +3370,10 @@ func (m *GetTaskResponse) Unmarshal(dAtA []byte) error {
|
|||||||
if postIndex > l {
|
if postIndex > l {
|
||||||
return io.ErrUnexpectedEOF
|
return io.ErrUnexpectedEOF
|
||||||
}
|
}
|
||||||
if m.Task == nil {
|
if m.Process == nil {
|
||||||
m.Task = &containerd_v1_types.Task{}
|
m.Process = &containerd_v1_types.Process{}
|
||||||
}
|
}
|
||||||
if err := m.Task.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
|
if err := m.Process.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
iNdEx = postIndex
|
iNdEx = postIndex
|
||||||
@ -3491,7 +3532,7 @@ func (m *ListTasksResponse) Unmarshal(dAtA []byte) error {
|
|||||||
if postIndex > l {
|
if postIndex > l {
|
||||||
return io.ErrUnexpectedEOF
|
return io.ErrUnexpectedEOF
|
||||||
}
|
}
|
||||||
m.Tasks = append(m.Tasks, &containerd_v1_types.Task{})
|
m.Tasks = append(m.Tasks, &containerd_v1_types.Process{})
|
||||||
if err := m.Tasks[len(m.Tasks)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
|
if err := m.Tasks[len(m.Tasks)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
@ -5029,81 +5070,81 @@ func init() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
var fileDescriptorTasks = []byte{
|
var fileDescriptorTasks = []byte{
|
||||||
// 1211 bytes of a gzipped FileDescriptorProto
|
// 1207 bytes of a gzipped FileDescriptorProto
|
||||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x58, 0x5d, 0x6f, 0x1b, 0x45,
|
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x58, 0xcd, 0x6f, 0x1b, 0x45,
|
||||||
0x17, 0xee, 0xfa, 0x63, 0x63, 0x1f, 0x37, 0x6d, 0x3c, 0x6f, 0x9a, 0xd7, 0x5d, 0x2a, 0x3b, 0x2c,
|
0x14, 0xef, 0xfa, 0x63, 0x6d, 0x3f, 0x37, 0x6d, 0x32, 0xa4, 0xc1, 0x2c, 0x95, 0x1d, 0x16, 0x09,
|
||||||
0x12, 0x32, 0x85, 0xec, 0x52, 0x17, 0x71, 0x41, 0x2b, 0x44, 0x13, 0x87, 0xc8, 0x02, 0xd4, 0x74,
|
0x99, 0x42, 0x77, 0xa9, 0x8b, 0x7a, 0xa0, 0x15, 0x52, 0x13, 0x87, 0xc8, 0x02, 0xd4, 0x74, 0x53,
|
||||||
0x53, 0x10, 0xea, 0x8d, 0xd9, 0x78, 0x27, 0xce, 0x28, 0xf6, 0xce, 0x76, 0x67, 0x9c, 0x26, 0x70,
|
0x10, 0xca, 0xc5, 0x6c, 0xbc, 0x13, 0x67, 0x14, 0x7b, 0x77, 0xbb, 0x33, 0x4e, 0x13, 0x38, 0xc0,
|
||||||
0x01, 0x3f, 0xa1, 0xb7, 0x5c, 0xc0, 0xef, 0xc9, 0x25, 0x97, 0x08, 0xa1, 0x40, 0xfd, 0x2f, 0xb8,
|
0x9f, 0xd0, 0x0b, 0x07, 0x2e, 0xfc, 0x3d, 0x39, 0x72, 0x44, 0x08, 0x05, 0xea, 0xff, 0x82, 0x1b,
|
||||||
0x43, 0x3b, 0x33, 0xde, 0x6c, 0xec, 0xf8, 0x23, 0x75, 0xc3, 0x4d, 0x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 0x72, 0xab, 0x5a, 0x35, 0xef,
|
||||||
0x73, 0xe2, 0x39, 0x7a, 0x08, 0xd0, 0xda, 0xc7, 0xad, 0x83, 0x80, 0x12, 0x9f, 0x97, 0x72, 0xab,
|
0xc4, 0x7b, 0xf4, 0x08, 0xa0, 0xb5, 0x8f, 0x5b, 0x07, 0x61, 0x40, 0x7c, 0x56, 0xca, 0xaf, 0x6a,
|
||||||
0x5a, 0xb5, 0x50, 0xbb, 0x33, 0x7a, 0xac, 0x7a, 0xcc, 0xb8, 0x93, 0xb0, 0x47, 0x16, 0x2c, 0xd0,
|
0xd5, 0x62, 0xed, 0xf6, 0x68, 0x58, 0xf5, 0x18, 0x71, 0x27, 0x21, 0x8f, 0x2c, 0xc8, 0x05, 0x21,
|
||||||
0x80, 0x13, 0xea, 0xb3, 0x52, 0x5e, 0x40, 0x97, 0x2d, 0xc9, 0xa6, 0x35, 0x60, 0xd3, 0x7a, 0xe4,
|
0x23, 0x81, 0x4f, 0x4b, 0x05, 0xa1, 0xba, 0x6c, 0x49, 0x34, 0xad, 0x01, 0x9a, 0xd6, 0x63, 0xff,
|
||||||
0x1f, 0x3b, 0x03, 0x23, 0xf3, 0x19, 0xa0, 0x24, 0x93, 0x2c, 0xa0, 0x3e, 0xc3, 0xaf, 0x45, 0xe5,
|
0xd8, 0x19, 0x08, 0x99, 0x3b, 0x80, 0x92, 0x48, 0xd2, 0x30, 0xf0, 0x29, 0x7e, 0x2d, 0x28, 0x17,
|
||||||
0x12, 0xa4, 0x03, 0xe2, 0x95, 0x52, 0xab, 0x5a, 0x75, 0xd1, 0x89, 0x86, 0x66, 0x1b, 0xae, 0xef,
|
0x21, 0x1d, 0x12, 0xaf, 0x94, 0x5a, 0xd5, 0xaa, 0x0b, 0x0e, 0x5f, 0x9a, 0x6d, 0xb8, 0xbe, 0xcd,
|
||||||
0x70, 0x37, 0xe4, 0xf3, 0x04, 0xe8, 0x1d, 0x58, 0xc0, 0x47, 0xb8, 0xd5, 0x54, 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06, 0x47,
|
0x20, 0x86, 0x66, 0x05, 0xf4, 0x3d, 0xd2, 0x61, 0x38, 0x92, 0xd1, 0x3a, 0x6a, 0xc7, 0x8b, 0x26,
|
||||||
0xcd, 0xcc, 0x3a, 0x14, 0x13, 0xb6, 0x6a, 0x3f, 0x1b, 0xb2, 0x42, 0x82, 0x4b, 0x9a, 0xd0, 0x82,
|
0x21, 0x1b, 0xbf, 0x8d, 0xac, 0x20, 0xea, 0x92, 0x26, 0x18, 0x63, 0xb2, 0x5b, 0x29, 0x6a, 0xbe,
|
||||||
0x09, 0x1b, 0x4a, 0x3b, 0xf3, 0xa5, 0x06, 0x85, 0x2f, 0x48, 0xa7, 0x73, 0xd5, 0x14, 0x0b, 0x1d,
|
0xd4, 0xa0, 0xf8, 0x25, 0xe9, 0x74, 0xae, 0x1a, 0x24, 0x41, 0x38, 0xa4, 0xcd, 0x69, 0x45, 0xd6,
|
||||||
0x21, 0xed, 0x48, 0x2d, 0x64, 0xca, 0xa8, 0x59, 0x94, 0x61, 0x6e, 0xa7, 0x23, 0x12, 0x25, 0xe7,
|
0x96, 0xda, 0xf1, 0x52, 0x74, 0x3b, 0x1d, 0x51, 0x51, 0x79, 0x87, 0x2f, 0xcd, 0x7f, 0x35, 0x40,
|
||||||
0x44, 0x43, 0xf3, 0x1f, 0x0d, 0x50, 0x04, 0x7e, 0x03, 0xc1, 0x8f, 0xa5, 0x2e, 0x75, 0xb1, 0xd4,
|
0x5c, 0xf9, 0x0d, 0x54, 0x49, 0xcc, 0x89, 0xa9, 0x8b, 0x39, 0x31, 0x3d, 0x86, 0x13, 0x33, 0x63,
|
||||||
0xa5, 0xc7, 0x48, 0x5d, 0x66, 0xac, 0xd4, 0x65, 0x87, 0xa4, 0xae, 0x0a, 0x19, 0x16, 0xe0, 0x96,
|
0x39, 0x31, 0x3b, 0xc4, 0x89, 0x55, 0xc8, 0xd0, 0x10, 0xb7, 0x04, 0x8b, 0x8e, 0xa3, 0x34, 0x21,
|
||||||
0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|
0x8c, 0x4f, 0x2f, 0xa7, 0xa4, 0x1c, 0x3f, 0x05, 0x5d, 0x32, 0xf8, 0x34, 0xd8, 0x46, 0x78, 0x7e,
|
||||||
0x68, 0x1b, 0xd1, 0xfb, 0x71, 0xb4, 0xad, 0x7f, 0x73, 0xf2, 0xaa, 0x7c, 0xed, 0xf7, 0x57, 0xe5,
|
0x1c, 0x6c, 0x6b, 0xdf, 0x9e, 0xbc, 0x2a, 0x5f, 0xfb, 0xe3, 0x55, 0xf9, 0xda, 0xcf, 0xfd, 0xb2,
|
||||||
0x6b, 0x3f, 0xf5, 0xcb, 0xda, 0x49, 0xbf, 0xac, 0xfd, 0xd6, 0x2f, 0x6b, 0x7f, 0xf7, 0xcb, 0xda,
|
0x76, 0xd2, 0x2f, 0x6b, 0xbf, 0xf7, 0xcb, 0xda, 0x3f, 0xfd, 0xb2, 0xb6, 0xf3, 0xe8, 0xf5, 0xfe,
|
||||||
0xb3, 0x87, 0xaf, 0xf7, 0xcf, 0x93, 0x07, 0x62, 0xb0, 0xab, 0x8b, 0x7d, 0xee, 0xff, 0x1b, 0x00,
|
0xbb, 0xf2, 0x50, 0x2c, 0x76, 0x75, 0xe1, 0xe7, 0xfe, 0x7f, 0x01, 0x00, 0x00, 0xff, 0xff, 0x17,
|
||||||
0x00, 0xff, 0xff, 0x55, 0x8b, 0x54, 0x53, 0x83, 0x11, 0x00, 0x00,
|
0xec, 0xf8, 0x44, 0xa4, 0x11, 0x00, 0x00,
|
||||||
}
|
}
|
||||||
|
@ -24,7 +24,7 @@ service Tasks {
|
|||||||
|
|
||||||
rpc DeleteProcess(DeleteProcessRequest) returns (DeleteResponse);
|
rpc DeleteProcess(DeleteProcessRequest) returns (DeleteResponse);
|
||||||
|
|
||||||
rpc Get(GetTaskRequest) returns (GetTaskResponse);
|
rpc Get(GetRequest) returns (GetResponse);
|
||||||
|
|
||||||
rpc List(ListTasksRequest) returns (ListTasksResponse);
|
rpc List(ListTasksRequest) returns (ListTasksResponse);
|
||||||
|
|
||||||
@ -99,12 +99,13 @@ message DeleteProcessRequest {
|
|||||||
string exec_id = 2;
|
string exec_id = 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
message GetTaskRequest {
|
message GetRequest {
|
||||||
string container_id = 1;
|
string container_id = 1;
|
||||||
|
string exec_id = 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
message GetTaskResponse {
|
message GetResponse {
|
||||||
containerd.v1.types.Task task = 1;
|
containerd.v1.types.Process process = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
message ListTasksRequest {
|
message ListTasksRequest {
|
||||||
@ -112,7 +113,7 @@ message ListTasksRequest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
message ListTasksResponse {
|
message ListTasksResponse {
|
||||||
repeated containerd.v1.types.Task tasks = 1;
|
repeated containerd.v1.types.Process tasks = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
message KillRequest {
|
message KillRequest {
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
github.com/containerd/containerd/api/types/task/task.proto
|
github.com/containerd/containerd/api/types/task/task.proto
|
||||||
|
|
||||||
It has these top-level messages:
|
It has these top-level messages:
|
||||||
Task
|
Process
|
||||||
*/
|
*/
|
||||||
package task
|
package task
|
||||||
|
|
||||||
@ -17,7 +17,7 @@ import proto "github.com/gogo/protobuf/proto"
|
|||||||
import fmt "fmt"
|
import fmt "fmt"
|
||||||
import math "math"
|
import math "math"
|
||||||
import _ "github.com/gogo/protobuf/gogoproto"
|
import _ "github.com/gogo/protobuf/gogoproto"
|
||||||
import google_protobuf1 "github.com/gogo/protobuf/types"
|
import _ "github.com/gogo/protobuf/types"
|
||||||
|
|
||||||
import strings "strings"
|
import strings "strings"
|
||||||
import reflect "reflect"
|
import reflect "reflect"
|
||||||
@ -65,26 +65,26 @@ func (x Status) String() string {
|
|||||||
}
|
}
|
||||||
func (Status) EnumDescriptor() ([]byte, []int) { return fileDescriptorTask, []int{0} }
|
func (Status) EnumDescriptor() ([]byte, []int) { return fileDescriptorTask, []int{0} }
|
||||||
|
|
||||||
type Task struct {
|
type Process struct {
|
||||||
ID string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
|
ContainerID string `protobuf:"bytes,1,opt,name=container_id,json=containerId,proto3" json:"container_id,omitempty"`
|
||||||
Pid uint32 `protobuf:"varint,2,opt,name=pid,proto3" json:"pid,omitempty"`
|
ID string `protobuf:"bytes,2,opt,name=id,proto3" json:"id,omitempty"`
|
||||||
Status Status `protobuf:"varint,3,opt,name=status,proto3,enum=containerd.v1.types.Status" json:"status,omitempty"`
|
Pid uint32 `protobuf:"varint,3,opt,name=pid,proto3" json:"pid,omitempty"`
|
||||||
Spec *google_protobuf1.Any `protobuf:"bytes,4,opt,name=spec" json:"spec,omitempty"`
|
Status Status `protobuf:"varint,4,opt,name=status,proto3,enum=containerd.v1.types.Status" json:"status,omitempty"`
|
||||||
Stdin string `protobuf:"bytes,5,opt,name=stdin,proto3" json:"stdin,omitempty"`
|
Stdin string `protobuf:"bytes,5,opt,name=stdin,proto3" json:"stdin,omitempty"`
|
||||||
Stdout string `protobuf:"bytes,6,opt,name=stdout,proto3" json:"stdout,omitempty"`
|
Stdout string `protobuf:"bytes,6,opt,name=stdout,proto3" json:"stdout,omitempty"`
|
||||||
Stderr string `protobuf:"bytes,7,opt,name=stderr,proto3" json:"stderr,omitempty"`
|
Stderr string `protobuf:"bytes,7,opt,name=stderr,proto3" json:"stderr,omitempty"`
|
||||||
Terminal bool `protobuf:"varint,8,opt,name=terminal,proto3" json:"terminal,omitempty"`
|
Terminal bool `protobuf:"varint,8,opt,name=terminal,proto3" json:"terminal,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *Task) Reset() { *m = Task{} }
|
func (m *Process) Reset() { *m = Process{} }
|
||||||
func (*Task) ProtoMessage() {}
|
func (*Process) ProtoMessage() {}
|
||||||
func (*Task) Descriptor() ([]byte, []int) { return fileDescriptorTask, []int{0} }
|
func (*Process) Descriptor() ([]byte, []int) { return fileDescriptorTask, []int{0} }
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
proto.RegisterType((*Task)(nil), "containerd.v1.types.Task")
|
proto.RegisterType((*Process)(nil), "containerd.v1.types.Process")
|
||||||
proto.RegisterEnum("containerd.v1.types.Status", Status_name, Status_value)
|
proto.RegisterEnum("containerd.v1.types.Status", Status_name, Status_value)
|
||||||
}
|
}
|
||||||
func (m *Task) Marshal() (dAtA []byte, err error) {
|
func (m *Process) Marshal() (dAtA []byte, err error) {
|
||||||
size := m.Size()
|
size := m.Size()
|
||||||
dAtA = make([]byte, size)
|
dAtA = make([]byte, size)
|
||||||
n, err := m.MarshalTo(dAtA)
|
n, err := m.MarshalTo(dAtA)
|
||||||
@ -94,37 +94,33 @@ func (m *Task) Marshal() (dAtA []byte, err error) {
|
|||||||
return dAtA[:n], nil
|
return dAtA[:n], nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *Task) MarshalTo(dAtA []byte) (int, error) {
|
func (m *Process) MarshalTo(dAtA []byte) (int, error) {
|
||||||
var i int
|
var i int
|
||||||
_ = i
|
_ = i
|
||||||
var l int
|
var l int
|
||||||
_ = l
|
_ = l
|
||||||
if len(m.ID) > 0 {
|
if len(m.ContainerID) > 0 {
|
||||||
dAtA[i] = 0xa
|
dAtA[i] = 0xa
|
||||||
i++
|
i++
|
||||||
|
i = encodeVarintTask(dAtA, i, uint64(len(m.ContainerID)))
|
||||||
|
i += copy(dAtA[i:], m.ContainerID)
|
||||||
|
}
|
||||||
|
if len(m.ID) > 0 {
|
||||||
|
dAtA[i] = 0x12
|
||||||
|
i++
|
||||||
i = encodeVarintTask(dAtA, i, uint64(len(m.ID)))
|
i = encodeVarintTask(dAtA, i, uint64(len(m.ID)))
|
||||||
i += copy(dAtA[i:], m.ID)
|
i += copy(dAtA[i:], m.ID)
|
||||||
}
|
}
|
||||||
if m.Pid != 0 {
|
if m.Pid != 0 {
|
||||||
dAtA[i] = 0x10
|
dAtA[i] = 0x18
|
||||||
i++
|
i++
|
||||||
i = encodeVarintTask(dAtA, i, uint64(m.Pid))
|
i = encodeVarintTask(dAtA, i, uint64(m.Pid))
|
||||||
}
|
}
|
||||||
if m.Status != 0 {
|
if m.Status != 0 {
|
||||||
dAtA[i] = 0x18
|
dAtA[i] = 0x20
|
||||||
i++
|
i++
|
||||||
i = encodeVarintTask(dAtA, i, uint64(m.Status))
|
i = encodeVarintTask(dAtA, i, uint64(m.Status))
|
||||||
}
|
}
|
||||||
if m.Spec != nil {
|
|
||||||
dAtA[i] = 0x22
|
|
||||||
i++
|
|
||||||
i = encodeVarintTask(dAtA, i, uint64(m.Spec.Size()))
|
|
||||||
n1, err := m.Spec.MarshalTo(dAtA[i:])
|
|
||||||
if err != nil {
|
|
||||||
return 0, err
|
|
||||||
}
|
|
||||||
i += n1
|
|
||||||
}
|
|
||||||
if len(m.Stdin) > 0 {
|
if len(m.Stdin) > 0 {
|
||||||
dAtA[i] = 0x2a
|
dAtA[i] = 0x2a
|
||||||
i++
|
i++
|
||||||
@ -183,9 +179,13 @@ func encodeVarintTask(dAtA []byte, offset int, v uint64) int {
|
|||||||
dAtA[offset] = uint8(v)
|
dAtA[offset] = uint8(v)
|
||||||
return offset + 1
|
return offset + 1
|
||||||
}
|
}
|
||||||
func (m *Task) Size() (n int) {
|
func (m *Process) Size() (n int) {
|
||||||
var l int
|
var l int
|
||||||
_ = l
|
_ = l
|
||||||
|
l = len(m.ContainerID)
|
||||||
|
if l > 0 {
|
||||||
|
n += 1 + l + sovTask(uint64(l))
|
||||||
|
}
|
||||||
l = len(m.ID)
|
l = len(m.ID)
|
||||||
if l > 0 {
|
if l > 0 {
|
||||||
n += 1 + l + sovTask(uint64(l))
|
n += 1 + l + sovTask(uint64(l))
|
||||||
@ -196,10 +196,6 @@ func (m *Task) Size() (n int) {
|
|||||||
if m.Status != 0 {
|
if m.Status != 0 {
|
||||||
n += 1 + sovTask(uint64(m.Status))
|
n += 1 + sovTask(uint64(m.Status))
|
||||||
}
|
}
|
||||||
if m.Spec != nil {
|
|
||||||
l = m.Spec.Size()
|
|
||||||
n += 1 + l + sovTask(uint64(l))
|
|
||||||
}
|
|
||||||
l = len(m.Stdin)
|
l = len(m.Stdin)
|
||||||
if l > 0 {
|
if l > 0 {
|
||||||
n += 1 + l + sovTask(uint64(l))
|
n += 1 + l + sovTask(uint64(l))
|
||||||
@ -231,15 +227,15 @@ func sovTask(x uint64) (n int) {
|
|||||||
func sozTask(x uint64) (n int) {
|
func sozTask(x uint64) (n int) {
|
||||||
return sovTask(uint64((x << 1) ^ uint64((int64(x) >> 63))))
|
return sovTask(uint64((x << 1) ^ uint64((int64(x) >> 63))))
|
||||||
}
|
}
|
||||||
func (this *Task) String() string {
|
func (this *Process) String() string {
|
||||||
if this == nil {
|
if this == nil {
|
||||||
return "nil"
|
return "nil"
|
||||||
}
|
}
|
||||||
s := strings.Join([]string{`&Task{`,
|
s := strings.Join([]string{`&Process{`,
|
||||||
|
`ContainerID:` + fmt.Sprintf("%v", this.ContainerID) + `,`,
|
||||||
`ID:` + fmt.Sprintf("%v", this.ID) + `,`,
|
`ID:` + fmt.Sprintf("%v", this.ID) + `,`,
|
||||||
`Pid:` + fmt.Sprintf("%v", this.Pid) + `,`,
|
`Pid:` + fmt.Sprintf("%v", this.Pid) + `,`,
|
||||||
`Status:` + fmt.Sprintf("%v", this.Status) + `,`,
|
`Status:` + fmt.Sprintf("%v", this.Status) + `,`,
|
||||||
`Spec:` + strings.Replace(fmt.Sprintf("%v", this.Spec), "Any", "google_protobuf1.Any", 1) + `,`,
|
|
||||||
`Stdin:` + fmt.Sprintf("%v", this.Stdin) + `,`,
|
`Stdin:` + fmt.Sprintf("%v", this.Stdin) + `,`,
|
||||||
`Stdout:` + fmt.Sprintf("%v", this.Stdout) + `,`,
|
`Stdout:` + fmt.Sprintf("%v", this.Stdout) + `,`,
|
||||||
`Stderr:` + fmt.Sprintf("%v", this.Stderr) + `,`,
|
`Stderr:` + fmt.Sprintf("%v", this.Stderr) + `,`,
|
||||||
@ -256,7 +252,7 @@ func valueToStringTask(v interface{}) string {
|
|||||||
pv := reflect.Indirect(rv).Interface()
|
pv := reflect.Indirect(rv).Interface()
|
||||||
return fmt.Sprintf("*%v", pv)
|
return fmt.Sprintf("*%v", pv)
|
||||||
}
|
}
|
||||||
func (m *Task) Unmarshal(dAtA []byte) error {
|
func (m *Process) Unmarshal(dAtA []byte) error {
|
||||||
l := len(dAtA)
|
l := len(dAtA)
|
||||||
iNdEx := 0
|
iNdEx := 0
|
||||||
for iNdEx < l {
|
for iNdEx < l {
|
||||||
@ -279,13 +275,42 @@ func (m *Task) Unmarshal(dAtA []byte) error {
|
|||||||
fieldNum := int32(wire >> 3)
|
fieldNum := int32(wire >> 3)
|
||||||
wireType := int(wire & 0x7)
|
wireType := int(wire & 0x7)
|
||||||
if wireType == 4 {
|
if wireType == 4 {
|
||||||
return fmt.Errorf("proto: Task: wiretype end group for non-group")
|
return fmt.Errorf("proto: Process: wiretype end group for non-group")
|
||||||
}
|
}
|
||||||
if fieldNum <= 0 {
|
if fieldNum <= 0 {
|
||||||
return fmt.Errorf("proto: Task: illegal tag %d (wire type %d)", fieldNum, wire)
|
return fmt.Errorf("proto: Process: illegal tag %d (wire type %d)", fieldNum, wire)
|
||||||
}
|
}
|
||||||
switch fieldNum {
|
switch fieldNum {
|
||||||
case 1:
|
case 1:
|
||||||
|
if wireType != 2 {
|
||||||
|
return fmt.Errorf("proto: wrong wireType = %d for field ContainerID", wireType)
|
||||||
|
}
|
||||||
|
var stringLen uint64
|
||||||
|
for shift := uint(0); ; shift += 7 {
|
||||||
|
if shift >= 64 {
|
||||||
|
return ErrIntOverflowTask
|
||||||
|
}
|
||||||
|
if iNdEx >= l {
|
||||||
|
return io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
b := dAtA[iNdEx]
|
||||||
|
iNdEx++
|
||||||
|
stringLen |= (uint64(b) & 0x7F) << shift
|
||||||
|
if b < 0x80 {
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
intStringLen := int(stringLen)
|
||||||
|
if intStringLen < 0 {
|
||||||
|
return ErrInvalidLengthTask
|
||||||
|
}
|
||||||
|
postIndex := iNdEx + intStringLen
|
||||||
|
if postIndex > l {
|
||||||
|
return io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
m.ContainerID = string(dAtA[iNdEx:postIndex])
|
||||||
|
iNdEx = postIndex
|
||||||
|
case 2:
|
||||||
if wireType != 2 {
|
if wireType != 2 {
|
||||||
return fmt.Errorf("proto: wrong wireType = %d for field ID", wireType)
|
return fmt.Errorf("proto: wrong wireType = %d for field ID", wireType)
|
||||||
}
|
}
|
||||||
@ -314,7 +339,7 @@ func (m *Task) Unmarshal(dAtA []byte) error {
|
|||||||
}
|
}
|
||||||
m.ID = string(dAtA[iNdEx:postIndex])
|
m.ID = string(dAtA[iNdEx:postIndex])
|
||||||
iNdEx = postIndex
|
iNdEx = postIndex
|
||||||
case 2:
|
case 3:
|
||||||
if wireType != 0 {
|
if wireType != 0 {
|
||||||
return fmt.Errorf("proto: wrong wireType = %d for field Pid", wireType)
|
return fmt.Errorf("proto: wrong wireType = %d for field Pid", wireType)
|
||||||
}
|
}
|
||||||
@ -333,7 +358,7 @@ func (m *Task) Unmarshal(dAtA []byte) error {
|
|||||||
break
|
break
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
case 3:
|
case 4:
|
||||||
if wireType != 0 {
|
if wireType != 0 {
|
||||||
return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType)
|
return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType)
|
||||||
}
|
}
|
||||||
@ -352,39 +377,6 @@ func (m *Task) Unmarshal(dAtA []byte) error {
|
|||||||
break
|
break
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
case 4:
|
|
||||||
if wireType != 2 {
|
|
||||||
return fmt.Errorf("proto: wrong wireType = %d for field Spec", wireType)
|
|
||||||
}
|
|
||||||
var msglen int
|
|
||||||
for shift := uint(0); ; shift += 7 {
|
|
||||||
if shift >= 64 {
|
|
||||||
return ErrIntOverflowTask
|
|
||||||
}
|
|
||||||
if iNdEx >= l {
|
|
||||||
return io.ErrUnexpectedEOF
|
|
||||||
}
|
|
||||||
b := dAtA[iNdEx]
|
|
||||||
iNdEx++
|
|
||||||
msglen |= (int(b) & 0x7F) << shift
|
|
||||||
if b < 0x80 {
|
|
||||||
break
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if msglen < 0 {
|
|
||||||
return ErrInvalidLengthTask
|
|
||||||
}
|
|
||||||
postIndex := iNdEx + msglen
|
|
||||||
if postIndex > l {
|
|
||||||
return io.ErrUnexpectedEOF
|
|
||||||
}
|
|
||||||
if m.Spec == nil {
|
|
||||||
m.Spec = &google_protobuf1.Any{}
|
|
||||||
}
|
|
||||||
if err := m.Spec.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
iNdEx = postIndex
|
|
||||||
case 5:
|
case 5:
|
||||||
if wireType != 2 {
|
if wireType != 2 {
|
||||||
return fmt.Errorf("proto: wrong wireType = %d for field Stdin", wireType)
|
return fmt.Errorf("proto: wrong wireType = %d for field Stdin", wireType)
|
||||||
@ -623,32 +615,33 @@ func init() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
var fileDescriptorTask = []byte{
|
var fileDescriptorTask = []byte{
|
||||||
// 431 bytes of a gzipped FileDescriptorProto
|
// 436 bytes of a gzipped FileDescriptorProto
|
||||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x6c, 0x90, 0xc1, 0x6e, 0xd3, 0x30,
|
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x6c, 0x91, 0x3f, 0x6f, 0xd3, 0x40,
|
||||||
0x1c, 0xc6, 0xeb, 0xb4, 0xcb, 0x8a, 0x61, 0x53, 0x30, 0xd5, 0x64, 0x02, 0x32, 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aa, 0x94, 0x22, 0xdc, 0xff, 0xfc,
|
0x7a, 0x3c, 0x9d, 0x8c, 0x62, 0x6f, 0xc3, 0xf7, 0xae, 0x6f, 0x82, 0xed, 0x16, 0xa7, 0x59, 0x55,
|
||||||
0x85, 0x74, 0xbe, 0x7f, 0x25, 0x1b, 0xdb, 0x63, 0x7c, 0x7d, 0x43, 0x3a, 0x3f, 0x6f, 0x48, 0xe7,
|
0x72, 0xe6, 0xef, 0x7e, 0xf9, 0x4a, 0x3a, 0x3f, 0xbe, 0x91, 0xe5, 0xdb, 0x9e, 0xe0, 0xdb, 0x05,
|
||||||
0x53, 0x4d, 0xc0, 0x75, 0x4d, 0xc0, 0x8f, 0x9a, 0x80, 0xdf, 0x35, 0x01, 0x0b, 0xdf, 0x3d, 0xe4,
|
0xe9, 0xfc, 0x5a, 0x90, 0xce, 0xe7, 0x9a, 0x80, 0xdb, 0x9a, 0x80, 0x9f, 0x35, 0x01, 0xbf, 0x6b,
|
||||||
0xd1, 0xdf, 0x00, 0x00, 0x00, 0xff, 0xff, 0xdf, 0xcf, 0x9e, 0x89, 0x51, 0x02, 0x00, 0x00,
|
0x02, 0x66, 0xae, 0xfd, 0xb5, 0x47, 0x7f, 0x03, 0x00, 0x00, 0xff, 0xff, 0x2d, 0x82, 0xe5, 0xdf,
|
||||||
|
0x5e, 0x02, 0x00, 0x00,
|
||||||
}
|
}
|
||||||
|
@ -16,11 +16,11 @@ enum Status {
|
|||||||
PAUSED = 4 [(gogoproto.enumvalue_customname) = "StatusPaused"];
|
PAUSED = 4 [(gogoproto.enumvalue_customname) = "StatusPaused"];
|
||||||
}
|
}
|
||||||
|
|
||||||
message Task {
|
message Process {
|
||||||
string id = 1;
|
string container_id = 1;
|
||||||
uint32 pid = 2;
|
string id = 2;
|
||||||
Status status = 3;
|
uint32 pid = 3;
|
||||||
google.protobuf.Any spec = 4;
|
Status status = 4;
|
||||||
string stdin = 5;
|
string stdin = 5;
|
||||||
string stdout = 6;
|
string stdout = 6;
|
||||||
string stderr = 7;
|
string stderr = 7;
|
||||||
|
20
container.go
20
container.go
@ -232,7 +232,7 @@ func (c *container) NewTask(ctx context.Context, ioCreate IOCreation, opts ...Ne
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (c *container) loadTask(ctx context.Context, ioAttach IOAttach) (Task, error) {
|
func (c *container) loadTask(ctx context.Context, ioAttach IOAttach) (Task, error) {
|
||||||
response, err := c.client.TaskService().Get(ctx, &tasks.GetTaskRequest{
|
response, err := c.client.TaskService().Get(ctx, &tasks.GetRequest{
|
||||||
ContainerID: c.c.ID,
|
ContainerID: c.c.ID,
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -247,14 +247,14 @@ func (c *container) loadTask(ctx context.Context, ioAttach IOAttach) (Task, erro
|
|||||||
// get the existing fifo paths from the task information stored by the daemon
|
// get the existing fifo paths from the task information stored by the daemon
|
||||||
paths := &FIFOSet{
|
paths := &FIFOSet{
|
||||||
Dir: getFifoDir([]string{
|
Dir: getFifoDir([]string{
|
||||||
response.Task.Stdin,
|
response.Process.Stdin,
|
||||||
response.Task.Stdout,
|
response.Process.Stdout,
|
||||||
response.Task.Stderr,
|
response.Process.Stderr,
|
||||||
}),
|
}),
|
||||||
In: response.Task.Stdin,
|
In: response.Process.Stdin,
|
||||||
Out: response.Task.Stdout,
|
Out: response.Process.Stdout,
|
||||||
Err: response.Task.Stderr,
|
Err: response.Process.Stderr,
|
||||||
Terminal: response.Task.Terminal,
|
Terminal: response.Process.Terminal,
|
||||||
}
|
}
|
||||||
if i, err = ioAttach(paths); err != nil {
|
if i, err = ioAttach(paths); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
@ -263,8 +263,8 @@ func (c *container) loadTask(ctx context.Context, ioAttach IOAttach) (Task, erro
|
|||||||
t := &task{
|
t := &task{
|
||||||
client: c.client,
|
client: c.client,
|
||||||
io: i,
|
io: i,
|
||||||
id: response.Task.ID,
|
id: response.Process.ID,
|
||||||
pid: response.Task.Pid,
|
pid: response.Process.Pid,
|
||||||
}
|
}
|
||||||
return t, nil
|
return t, nil
|
||||||
}
|
}
|
||||||
|
@ -27,6 +27,7 @@ import (
|
|||||||
type execProcess struct {
|
type execProcess struct {
|
||||||
sync.WaitGroup
|
sync.WaitGroup
|
||||||
|
|
||||||
|
mu sync.Mutex
|
||||||
id string
|
id string
|
||||||
console console.Console
|
console console.Console
|
||||||
io runc.IO
|
io runc.IO
|
||||||
@ -73,6 +74,8 @@ func (e *execProcess) ID() string {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (e *execProcess) Pid() int {
|
func (e *execProcess) Pid() int {
|
||||||
|
e.mu.Lock()
|
||||||
|
defer e.mu.Unlock()
|
||||||
return e.pid
|
return e.pid
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -109,9 +112,14 @@ func (e *execProcess) Resize(ws console.WinSize) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (e *execProcess) Kill(ctx context.Context, sig uint32, _ bool) error {
|
func (e *execProcess) Kill(ctx context.Context, sig uint32, _ bool) error {
|
||||||
if err := unix.Kill(e.pid, syscall.Signal(sig)); err != nil {
|
e.mu.Lock()
|
||||||
|
pid := e.pid
|
||||||
|
e.mu.Unlock()
|
||||||
|
if pid != 0 {
|
||||||
|
if err := unix.Kill(pid, syscall.Signal(sig)); err != nil {
|
||||||
return errors.Wrapf(checkKillError(err), "exec kill error")
|
return errors.Wrapf(checkKillError(err), "exec kill error")
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -179,6 +187,33 @@ func (e *execProcess) Start(ctx context.Context) (err error) {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return errors.Wrap(err, "failed to retrieve OCI runtime exec pid")
|
return errors.Wrap(err, "failed to retrieve OCI runtime exec pid")
|
||||||
}
|
}
|
||||||
|
e.mu.Lock()
|
||||||
e.pid = pid
|
e.pid = pid
|
||||||
|
e.mu.Unlock()
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (e *execProcess) Status(ctx context.Context) (string, error) {
|
||||||
|
s, err := e.parent.Status(ctx)
|
||||||
|
if err != nil {
|
||||||
|
return "", err
|
||||||
|
}
|
||||||
|
// if the container as a whole is in the pausing/paused state, so are all
|
||||||
|
// other processes inside the container, use container state here
|
||||||
|
switch s {
|
||||||
|
case "paused", "pausing":
|
||||||
|
return s, nil
|
||||||
|
}
|
||||||
|
e.mu.Lock()
|
||||||
|
defer e.mu.Unlock()
|
||||||
|
// if we don't have a pid then the exec process has just been created
|
||||||
|
if e.pid == 0 {
|
||||||
|
return "created", nil
|
||||||
|
}
|
||||||
|
// if we have a pid and it can be signaled, the process is running
|
||||||
|
if err := unix.Kill(e.pid, 0); err == nil {
|
||||||
|
return "running", nil
|
||||||
|
}
|
||||||
|
// else if we have a pid but it can nolonger be signaled, it has stopped
|
||||||
|
return "stopped", nil
|
||||||
|
}
|
||||||
|
@ -209,8 +209,8 @@ func (p *initProcess) ExitedAt() time.Time {
|
|||||||
return p.exited
|
return p.exited
|
||||||
}
|
}
|
||||||
|
|
||||||
// ContainerStatus return the state of the container (created, running, paused, stopped)
|
// Status return the state of the container (created, running, paused, stopped)
|
||||||
func (p *initProcess) ContainerStatus(ctx context.Context) (string, error) {
|
func (p *initProcess) Status(ctx context.Context) (string, error) {
|
||||||
c, err := p.runtime.State(ctx, p.id)
|
c, err := p.runtime.State(ctx, p.id)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return "", p.runtimeError(err, "OCI runtime state failed")
|
return "", p.runtimeError(err, "OCI runtime state failed")
|
||||||
@ -233,7 +233,7 @@ func (p *initProcess) SetExited(status int) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (p *initProcess) Delete(context context.Context) error {
|
func (p *initProcess) Delete(context context.Context) error {
|
||||||
status, err := p.ContainerStatus(context)
|
status, err := p.Status(context)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
@ -40,4 +40,6 @@ type process interface {
|
|||||||
Stdio() stdio
|
Stdio() stdio
|
||||||
// Start execution of the process
|
// Start execution of the process
|
||||||
Start(context.Context) error
|
Start(context.Context) error
|
||||||
|
// Status returns the process status
|
||||||
|
Status(ctx context.Context) (string, error)
|
||||||
}
|
}
|
||||||
|
@ -229,14 +229,11 @@ func (s *Service) ResizePty(ctx context.Context, r *shimapi.ResizePtyRequest) (*
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (s *Service) State(ctx context.Context, r *shimapi.StateRequest) (*shimapi.StateResponse, error) {
|
func (s *Service) State(ctx context.Context, r *shimapi.StateRequest) (*shimapi.StateResponse, error) {
|
||||||
if s.initProcess == nil {
|
|
||||||
return nil, errdefs.ToGRPCf(errdefs.ErrFailedPrecondition, "container must be created")
|
|
||||||
}
|
|
||||||
p, ok := s.processes[r.ID]
|
p, ok := s.processes[r.ID]
|
||||||
if !ok {
|
if !ok {
|
||||||
return nil, errdefs.ToGRPCf(errdefs.ErrNotFound, "process id %s not found", r.ID)
|
return nil, errdefs.ToGRPCf(errdefs.ErrNotFound, "process id %s not found", r.ID)
|
||||||
}
|
}
|
||||||
st, err := s.initProcess.ContainerStatus(ctx)
|
st, err := p.Status(ctx)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
@ -66,7 +66,6 @@ func (t *Task) State(ctx context.Context) (runtime.State, error) {
|
|||||||
status = runtime.StoppedStatus
|
status = runtime.StoppedStatus
|
||||||
case task.StatusPaused:
|
case task.StatusPaused:
|
||||||
status = runtime.PausedStatus
|
status = runtime.PausedStatus
|
||||||
// TODO: containerd.DeletedStatus
|
|
||||||
}
|
}
|
||||||
return runtime.State{
|
return runtime.State{
|
||||||
Pid: response.Pid,
|
Pid: response.Pid,
|
||||||
|
13
process.go
13
process.go
@ -2,10 +2,12 @@ package containerd
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
"strings"
|
||||||
"syscall"
|
"syscall"
|
||||||
|
|
||||||
eventsapi "github.com/containerd/containerd/api/services/events/v1"
|
eventsapi "github.com/containerd/containerd/api/services/events/v1"
|
||||||
"github.com/containerd/containerd/api/services/tasks/v1"
|
"github.com/containerd/containerd/api/services/tasks/v1"
|
||||||
|
"github.com/containerd/containerd/errdefs"
|
||||||
"github.com/containerd/containerd/runtime"
|
"github.com/containerd/containerd/runtime"
|
||||||
"github.com/containerd/containerd/typeurl"
|
"github.com/containerd/containerd/typeurl"
|
||||||
specs "github.com/opencontainers/runtime-spec/specs-go"
|
specs "github.com/opencontainers/runtime-spec/specs-go"
|
||||||
@ -121,3 +123,14 @@ func (p *process) Delete(ctx context.Context) (uint32, error) {
|
|||||||
}
|
}
|
||||||
return r.ExitStatus, nil
|
return r.ExitStatus, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (p *process) Status(ctx context.Context) (TaskStatus, error) {
|
||||||
|
r, err := p.task.client.TaskService().Get(ctx, &tasks.GetRequest{
|
||||||
|
ContainerID: p.task.id,
|
||||||
|
ExecID: p.id,
|
||||||
|
})
|
||||||
|
if err != nil {
|
||||||
|
return "", errdefs.FromGRPC(err)
|
||||||
|
}
|
||||||
|
return TaskStatus(strings.ToLower(r.Process.Status.String())), nil
|
||||||
|
}
|
||||||
|
@ -212,8 +212,8 @@ func (s *Service) DeleteProcess(ctx context.Context, r *api.DeleteProcessRequest
|
|||||||
}, nil
|
}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func taskFromContainerd(ctx context.Context, c runtime.Task) (*task.Task, error) {
|
func processFromContainerd(ctx context.Context, p runtime.Process) (*task.Process, error) {
|
||||||
state, err := c.State(ctx)
|
state, err := p.State(ctx)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
@ -230,8 +230,8 @@ func taskFromContainerd(ctx context.Context, c runtime.Task) (*task.Task, error)
|
|||||||
default:
|
default:
|
||||||
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.Process{
|
||||||
ID: c.Info().ID,
|
ID: p.ID(),
|
||||||
Pid: state.Pid,
|
Pid: state.Pid,
|
||||||
Status: status,
|
Status: status,
|
||||||
Stdin: state.Stdin,
|
Stdin: state.Stdin,
|
||||||
@ -241,17 +241,23 @@ func taskFromContainerd(ctx context.Context, c runtime.Task) (*task.Task, error)
|
|||||||
}, nil
|
}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *Service) Get(ctx context.Context, r *api.GetTaskRequest) (*api.GetTaskResponse, error) {
|
func (s *Service) Get(ctx context.Context, r *api.GetRequest) (*api.GetResponse, error) {
|
||||||
task, err := s.getTask(ctx, r.ContainerID)
|
task, err := s.getTask(ctx, r.ContainerID)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
t, err := taskFromContainerd(ctx, task)
|
p := runtime.Process(task)
|
||||||
|
if r.ExecID != "" {
|
||||||
|
if p, err = task.Process(ctx, r.ExecID); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
}
|
||||||
|
t, err := processFromContainerd(ctx, p)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
return &api.GetTaskResponse{
|
return &api.GetResponse{
|
||||||
Task: t,
|
Process: t,
|
||||||
}, nil
|
}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -263,7 +269,7 @@ func (s *Service) List(ctx context.Context, r *api.ListTasksRequest) (*api.ListT
|
|||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
for _, t := range tasks {
|
for _, t := range tasks {
|
||||||
tt, err := taskFromContainerd(ctx, t)
|
tt, err := processFromContainerd(ctx, t)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
5
task.go
5
task.go
@ -88,6 +88,7 @@ type Process interface {
|
|||||||
CloseIO(context.Context, ...IOCloserOpts) error
|
CloseIO(context.Context, ...IOCloserOpts) error
|
||||||
Resize(ctx context.Context, w, h uint32) error
|
Resize(ctx context.Context, w, h uint32) error
|
||||||
IO() *IO
|
IO() *IO
|
||||||
|
Status(context.Context) (TaskStatus, error)
|
||||||
}
|
}
|
||||||
|
|
||||||
var _ = (Task)(&task{})
|
var _ = (Task)(&task{})
|
||||||
@ -153,13 +154,13 @@ func (t *task) Resume(ctx context.Context) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (t *task) Status(ctx context.Context) (TaskStatus, error) {
|
func (t *task) Status(ctx context.Context) (TaskStatus, error) {
|
||||||
r, err := t.client.TaskService().Get(ctx, &tasks.GetTaskRequest{
|
r, err := t.client.TaskService().Get(ctx, &tasks.GetRequest{
|
||||||
ContainerID: t.id,
|
ContainerID: t.id,
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return "", errdefs.FromGRPC(err)
|
return "", errdefs.FromGRPC(err)
|
||||||
}
|
}
|
||||||
return TaskStatus(strings.ToLower(r.Task.Status.String())), nil
|
return TaskStatus(strings.ToLower(r.Process.Status.String())), nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// Wait is a blocking call that will wait for the task to exit and return the exit status
|
// Wait is a blocking call that will wait for the task to exit and return the exit status
|
||||||
|
Loading…
Reference in New Issue
Block a user