Merge pull request #1406 from mlaventure/add-exitedat-to-process
Add ExitedAt to process proto definition
This commit is contained in:
commit
3e81b092de
@ -17,6 +17,11 @@ 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 _ "github.com/gogo/protobuf/types"
|
||||||
|
|
||||||
|
import time "time"
|
||||||
|
|
||||||
|
import github_com_gogo_protobuf_types "github.com/gogo/protobuf/types"
|
||||||
|
|
||||||
import strings "strings"
|
import strings "strings"
|
||||||
import reflect "reflect"
|
import reflect "reflect"
|
||||||
@ -27,6 +32,7 @@ import io "io"
|
|||||||
var _ = proto.Marshal
|
var _ = proto.Marshal
|
||||||
var _ = fmt.Errorf
|
var _ = fmt.Errorf
|
||||||
var _ = math.Inf
|
var _ = math.Inf
|
||||||
|
var _ = time.Kitchen
|
||||||
|
|
||||||
// This is a compile-time assertion to ensure that this generated file
|
// This is a compile-time assertion to ensure that this generated file
|
||||||
// is compatible with the proto package it is being compiled against.
|
// is compatible with the proto package it is being compiled against.
|
||||||
@ -68,15 +74,16 @@ func (x Status) String() string {
|
|||||||
func (Status) EnumDescriptor() ([]byte, []int) { return fileDescriptorTask, []int{0} }
|
func (Status) EnumDescriptor() ([]byte, []int) { return fileDescriptorTask, []int{0} }
|
||||||
|
|
||||||
type Process struct {
|
type Process 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"`
|
||||||
ID string `protobuf:"bytes,2,opt,name=id,proto3" json:"id,omitempty"`
|
ID string `protobuf:"bytes,2,opt,name=id,proto3" json:"id,omitempty"`
|
||||||
Pid uint32 `protobuf:"varint,3,opt,name=pid,proto3" json:"pid,omitempty"`
|
Pid uint32 `protobuf:"varint,3,opt,name=pid,proto3" json:"pid,omitempty"`
|
||||||
Status Status `protobuf:"varint,4,opt,name=status,proto3,enum=containerd.v1.types.Status" json:"status,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"`
|
||||||
ExitStatus uint32 `protobuf:"varint,9,opt,name=exit_status,json=exitStatus,proto3" json:"exit_status,omitempty"`
|
ExitStatus uint32 `protobuf:"varint,9,opt,name=exit_status,json=exitStatus,proto3" json:"exit_status,omitempty"`
|
||||||
|
ExitedAt time.Time `protobuf:"bytes,10,opt,name=exited_at,json=exitedAt,stdtime" json:"exited_at"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *Process) Reset() { *m = Process{} }
|
func (m *Process) Reset() { *m = Process{} }
|
||||||
@ -157,6 +164,14 @@ func (m *Process) MarshalTo(dAtA []byte) (int, error) {
|
|||||||
i++
|
i++
|
||||||
i = encodeVarintTask(dAtA, i, uint64(m.ExitStatus))
|
i = encodeVarintTask(dAtA, i, uint64(m.ExitStatus))
|
||||||
}
|
}
|
||||||
|
dAtA[i] = 0x52
|
||||||
|
i++
|
||||||
|
i = encodeVarintTask(dAtA, i, uint64(github_com_gogo_protobuf_types.SizeOfStdTime(m.ExitedAt)))
|
||||||
|
n1, err := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.ExitedAt, dAtA[i:])
|
||||||
|
if err != nil {
|
||||||
|
return 0, err
|
||||||
|
}
|
||||||
|
i += n1
|
||||||
return i, nil
|
return i, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -222,6 +237,8 @@ func (m *Process) Size() (n int) {
|
|||||||
if m.ExitStatus != 0 {
|
if m.ExitStatus != 0 {
|
||||||
n += 1 + sovTask(uint64(m.ExitStatus))
|
n += 1 + sovTask(uint64(m.ExitStatus))
|
||||||
}
|
}
|
||||||
|
l = github_com_gogo_protobuf_types.SizeOfStdTime(m.ExitedAt)
|
||||||
|
n += 1 + l + sovTask(uint64(l))
|
||||||
return n
|
return n
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -252,6 +269,7 @@ func (this *Process) String() string {
|
|||||||
`Stderr:` + fmt.Sprintf("%v", this.Stderr) + `,`,
|
`Stderr:` + fmt.Sprintf("%v", this.Stderr) + `,`,
|
||||||
`Terminal:` + fmt.Sprintf("%v", this.Terminal) + `,`,
|
`Terminal:` + fmt.Sprintf("%v", this.Terminal) + `,`,
|
||||||
`ExitStatus:` + fmt.Sprintf("%v", this.ExitStatus) + `,`,
|
`ExitStatus:` + fmt.Sprintf("%v", this.ExitStatus) + `,`,
|
||||||
|
`ExitedAt:` + strings.Replace(strings.Replace(this.ExitedAt.String(), "Timestamp", "google_protobuf1.Timestamp", 1), `&`, ``, 1) + `,`,
|
||||||
`}`,
|
`}`,
|
||||||
}, "")
|
}, "")
|
||||||
return s
|
return s
|
||||||
@ -515,6 +533,36 @@ func (m *Process) Unmarshal(dAtA []byte) error {
|
|||||||
break
|
break
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
case 10:
|
||||||
|
if wireType != 2 {
|
||||||
|
return fmt.Errorf("proto: wrong wireType = %d for field ExitedAt", 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 err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.ExitedAt, dAtA[iNdEx:postIndex]); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
iNdEx = postIndex
|
||||||
default:
|
default:
|
||||||
iNdEx = preIndex
|
iNdEx = preIndex
|
||||||
skippy, err := skipTask(dAtA[iNdEx:])
|
skippy, err := skipTask(dAtA[iNdEx:])
|
||||||
@ -646,33 +694,37 @@ func init() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
var fileDescriptorTask = []byte{
|
var fileDescriptorTask = []byte{
|
||||||
// 447 bytes of a gzipped FileDescriptorProto
|
// 503 bytes of a gzipped FileDescriptorProto
|
||||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x6c, 0x92, 0x4f, 0x6f, 0xd3, 0x30,
|
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x6c, 0x90, 0x3d, 0x6f, 0xd3, 0x40,
|
||||||
0x18, 0xc6, 0xeb, 0x74, 0x4d, 0x3b, 0x77, 0x1b, 0xc1, 0x4c, 0x93, 0x55, 0x90, 0x1b, 0x71, 0xaa,
|
0x1c, 0xc6, 0x73, 0x6e, 0xe3, 0x24, 0x97, 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0x88, 0xa9, 0x15, 0x49, 0x3d, 0xdf, 0x3a, 0xda,
|
||||||
0xdd, 0xdc, 0x24, 0xa6, 0xc8, 0xf1, 0x96, 0x0f, 0x26, 0x7b, 0x87, 0x8f, 0x83, 0xff, 0xb4, 0x0c,
|
0x78, 0x88, 0x35, 0x46, 0x90, 0x01, 0x8f, 0x62, 0x46, 0xcc, 0x23, 0x17, 0x74, 0x4e, 0xb1, 0x3a,
|
||||||
0x96, 0x55, 0x84, 0x36, 0x51, 0xb4, 0x0f, 0x7b, 0xb9, 0x61, 0x42, 0xe2, 0x9e, 0x7d, 0x03, 0xad,
|
0xa2, 0x4b, 0xa8, 0xa7, 0x32, 0x94, 0x59, 0x6a, 0x1e, 0xbb, 0xa0, 0x73, 0xd6, 0x7d, 0xec, 0xfd,
|
||||||
0x07, 0x74, 0x60, 0x4f, 0x31, 0x55, 0x18, 0xec, 0x56, 0x76, 0x33, 0x35, 0x3e, 0xd7, 0x1a, 0xf7,
|
0xe7, 0x19, 0xde, 0xb4, 0x88, 0xe0, 0x2a, 0x8a, 0xce, 0x61, 0x3d, 0x95, 0x84, 0x71, 0xb3, 0xae,
|
||||||
0x37, 0x3e, 0xd7, 0x1a, 0x8d, 0xe0, 0xc0, 0x70, 0x7d, 0x25, 0x64, 0xf2, 0x16, 0x0f, 0x7c, 0x30,
|
0xfe, 0x80, 0x4b, 0x81, 0x2e, 0x54, 0x15, 0x11, 0x99, 0x34, 0xf5, 0xc2, 0xae, 0x54, 0xe5, 0xd3,
|
||||||
0x19, 0xd0, 0xcd, 0x8c, 0xc6, 0x70, 0xc8, 0x3f, 0x08, 0x73, 0xde, 0x74, 0xdb, 0xae, 0x0a, 0x43,
|
0x24, 0x31, 0x1b, 0x7b, 0x9f, 0x26, 0x09, 0xb2, 0x60, 0x53, 0xd2, 0x64, 0xcd, 0x78, 0x78, 0x63,
|
||||||
0x6b, 0xd5, 0x55, 0x9e, 0xfd, 0x04, 0xd0, 0xad, 0x25, 0x22, 0xb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xa9, 0x17, 0xab, 0xb9, 0xfc, 0x1b, 0x00, 0x00, 0xff, 0xff, 0x14,
|
||||||
|
0xf3, 0xee, 0x85, 0xe8, 0x02, 0x00, 0x00,
|
||||||
}
|
}
|
||||||
|
@ -3,6 +3,7 @@ syntax = "proto3";
|
|||||||
package containerd.v1.types;
|
package containerd.v1.types;
|
||||||
|
|
||||||
import "gogoproto/gogo.proto";
|
import "gogoproto/gogo.proto";
|
||||||
|
import "google/protobuf/timestamp.proto";
|
||||||
|
|
||||||
enum Status {
|
enum Status {
|
||||||
option (gogoproto.goproto_enum_prefix) = false;
|
option (gogoproto.goproto_enum_prefix) = false;
|
||||||
@ -26,4 +27,5 @@ message Process {
|
|||||||
string stderr = 7;
|
string stderr = 7;
|
||||||
bool terminal = 8;
|
bool terminal = 8;
|
||||||
uint32 exit_status = 9;
|
uint32 exit_status = 9;
|
||||||
|
google.protobuf.Timestamp exited_at = 10 [(gogoproto.stdtime) = true, (gogoproto.nullable) = false];
|
||||||
}
|
}
|
||||||
|
@ -11,6 +11,7 @@ import (
|
|||||||
"sync"
|
"sync"
|
||||||
"syscall"
|
"syscall"
|
||||||
"testing"
|
"testing"
|
||||||
|
"time"
|
||||||
|
|
||||||
// Register the typeurl
|
// Register the typeurl
|
||||||
_ "github.com/containerd/containerd/runtime"
|
_ "github.com/containerd/containerd/runtime"
|
||||||
@ -1375,3 +1376,78 @@ func TestContainerHostname(t *testing.T) {
|
|||||||
t.Errorf("expected output %q but received %q", expected, actual)
|
t.Errorf("expected output %q but received %q", expected, actual)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func TestContainerExitedAtSet(t *testing.T) {
|
||||||
|
t.Parallel()
|
||||||
|
|
||||||
|
client, err := newClient(t, address)
|
||||||
|
if err != nil {
|
||||||
|
t.Fatal(err)
|
||||||
|
}
|
||||||
|
defer client.Close()
|
||||||
|
|
||||||
|
var (
|
||||||
|
image Image
|
||||||
|
ctx, cancel = testContext()
|
||||||
|
id = t.Name()
|
||||||
|
)
|
||||||
|
defer cancel()
|
||||||
|
|
||||||
|
if runtime.GOOS != "windows" {
|
||||||
|
image, err = client.GetImage(ctx, testImage)
|
||||||
|
if err != nil {
|
||||||
|
t.Error(err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
spec, err := generateSpec(withImageConfig(ctx, image), withTrue())
|
||||||
|
if err != nil {
|
||||||
|
t.Error(err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
container, err := client.NewContainer(ctx, id, WithSpec(spec), withNewSnapshot(id, image))
|
||||||
|
if err != nil {
|
||||||
|
t.Error(err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
defer container.Delete(ctx, WithSnapshotCleanup)
|
||||||
|
|
||||||
|
task, err := container.NewTask(ctx, empty())
|
||||||
|
if err != nil {
|
||||||
|
t.Error(err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
defer task.Delete(ctx)
|
||||||
|
|
||||||
|
statusC := make(chan uint32, 1)
|
||||||
|
go func() {
|
||||||
|
status, err := task.Wait(ctx)
|
||||||
|
if err != nil {
|
||||||
|
t.Error(err)
|
||||||
|
}
|
||||||
|
statusC <- status
|
||||||
|
}()
|
||||||
|
|
||||||
|
startTime := time.Now()
|
||||||
|
if err := task.Start(ctx); err != nil {
|
||||||
|
t.Error(err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
status := <-statusC
|
||||||
|
if status != 0 {
|
||||||
|
t.Errorf("expected status 0 but received %d", status)
|
||||||
|
}
|
||||||
|
|
||||||
|
if s, err := task.Status(ctx); err != nil {
|
||||||
|
t.Errorf("failed to retrieve status: %v", err)
|
||||||
|
} else if s.ExitTime.After(startTime) == false {
|
||||||
|
t.Errorf("exit time is not after start time: %v <= %v", startTime, s.ExitTime)
|
||||||
|
}
|
||||||
|
|
||||||
|
if _, err := task.Delete(ctx); err != nil {
|
||||||
|
t.Error(err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@ -265,6 +265,7 @@ func (s *Service) State(ctx context.Context, r *shimapi.StateRequest) (*shimapi.
|
|||||||
Stderr: sio.stderr,
|
Stderr: sio.stderr,
|
||||||
Terminal: sio.terminal,
|
Terminal: sio.terminal,
|
||||||
ExitStatus: uint32(p.ExitStatus()),
|
ExitStatus: uint32(p.ExitStatus()),
|
||||||
|
ExitedAt: p.ExitedAt(),
|
||||||
}, nil
|
}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -158,6 +158,7 @@ type StateResponse struct {
|
|||||||
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"`
|
||||||
ExitStatus uint32 `protobuf:"varint,9,opt,name=exit_status,json=exitStatus,proto3" json:"exit_status,omitempty"`
|
ExitStatus uint32 `protobuf:"varint,9,opt,name=exit_status,json=exitStatus,proto3" json:"exit_status,omitempty"`
|
||||||
|
ExitedAt time.Time `protobuf:"bytes,10,opt,name=exited_at,json=exitedAt,stdtime" json:"exited_at"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *StateResponse) Reset() { *m = StateResponse{} }
|
func (m *StateResponse) Reset() { *m = StateResponse{} }
|
||||||
@ -1189,6 +1190,14 @@ func (m *StateResponse) MarshalTo(dAtA []byte) (int, error) {
|
|||||||
i++
|
i++
|
||||||
i = encodeVarintShim(dAtA, i, uint64(m.ExitStatus))
|
i = encodeVarintShim(dAtA, i, uint64(m.ExitStatus))
|
||||||
}
|
}
|
||||||
|
dAtA[i] = 0x52
|
||||||
|
i++
|
||||||
|
i = encodeVarintShim(dAtA, i, uint64(github_com_gogo_protobuf_types.SizeOfStdTime(m.ExitedAt)))
|
||||||
|
n4, err := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.ExitedAt, dAtA[i:])
|
||||||
|
if err != nil {
|
||||||
|
return 0, err
|
||||||
|
}
|
||||||
|
i += n4
|
||||||
return i, nil
|
return i, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1305,21 +1314,21 @@ func (m *ListPidsResponse) MarshalTo(dAtA []byte) (int, error) {
|
|||||||
var l int
|
var l int
|
||||||
_ = l
|
_ = l
|
||||||
if len(m.Pids) > 0 {
|
if len(m.Pids) > 0 {
|
||||||
dAtA5 := make([]byte, len(m.Pids)*10)
|
dAtA6 := make([]byte, len(m.Pids)*10)
|
||||||
var j4 int
|
var j5 int
|
||||||
for _, num := range m.Pids {
|
for _, num := range m.Pids {
|
||||||
for num >= 1<<7 {
|
for num >= 1<<7 {
|
||||||
dAtA5[j4] = uint8(uint64(num)&0x7f | 0x80)
|
dAtA6[j5] = uint8(uint64(num)&0x7f | 0x80)
|
||||||
num >>= 7
|
num >>= 7
|
||||||
j4++
|
j5++
|
||||||
}
|
}
|
||||||
dAtA5[j4] = uint8(num)
|
dAtA6[j5] = uint8(num)
|
||||||
j4++
|
j5++
|
||||||
}
|
}
|
||||||
dAtA[i] = 0xa
|
dAtA[i] = 0xa
|
||||||
i++
|
i++
|
||||||
i = encodeVarintShim(dAtA, i, uint64(j4))
|
i = encodeVarintShim(dAtA, i, uint64(j5))
|
||||||
i += copy(dAtA[i:], dAtA5[:j4])
|
i += copy(dAtA[i:], dAtA6[:j5])
|
||||||
}
|
}
|
||||||
return i, nil
|
return i, nil
|
||||||
}
|
}
|
||||||
@ -1349,11 +1358,11 @@ func (m *CheckpointTaskRequest) MarshalTo(dAtA []byte) (int, error) {
|
|||||||
dAtA[i] = 0x12
|
dAtA[i] = 0x12
|
||||||
i++
|
i++
|
||||||
i = encodeVarintShim(dAtA, i, uint64(m.Options.Size()))
|
i = encodeVarintShim(dAtA, i, uint64(m.Options.Size()))
|
||||||
n6, err := m.Options.MarshalTo(dAtA[i:])
|
n7, err := m.Options.MarshalTo(dAtA[i:])
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return 0, err
|
return 0, err
|
||||||
}
|
}
|
||||||
i += n6
|
i += n7
|
||||||
}
|
}
|
||||||
return i, nil
|
return i, nil
|
||||||
}
|
}
|
||||||
@ -1400,11 +1409,11 @@ func (m *UpdateTaskRequest) MarshalTo(dAtA []byte) (int, error) {
|
|||||||
dAtA[i] = 0xa
|
dAtA[i] = 0xa
|
||||||
i++
|
i++
|
||||||
i = encodeVarintShim(dAtA, i, uint64(m.Resources.Size()))
|
i = encodeVarintShim(dAtA, i, uint64(m.Resources.Size()))
|
||||||
n7, err := m.Resources.MarshalTo(dAtA[i:])
|
n8, err := m.Resources.MarshalTo(dAtA[i:])
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return 0, err
|
return 0, err
|
||||||
}
|
}
|
||||||
i += n7
|
i += n8
|
||||||
}
|
}
|
||||||
return i, nil
|
return i, nil
|
||||||
}
|
}
|
||||||
@ -1669,6 +1678,8 @@ func (m *StateResponse) Size() (n int) {
|
|||||||
if m.ExitStatus != 0 {
|
if m.ExitStatus != 0 {
|
||||||
n += 1 + sovShim(uint64(m.ExitStatus))
|
n += 1 + sovShim(uint64(m.ExitStatus))
|
||||||
}
|
}
|
||||||
|
l = github_com_gogo_protobuf_types.SizeOfStdTime(m.ExitedAt)
|
||||||
|
n += 1 + l + sovShim(uint64(l))
|
||||||
return n
|
return n
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1905,6 +1916,7 @@ func (this *StateResponse) String() string {
|
|||||||
`Stderr:` + fmt.Sprintf("%v", this.Stderr) + `,`,
|
`Stderr:` + fmt.Sprintf("%v", this.Stderr) + `,`,
|
||||||
`Terminal:` + fmt.Sprintf("%v", this.Terminal) + `,`,
|
`Terminal:` + fmt.Sprintf("%v", this.Terminal) + `,`,
|
||||||
`ExitStatus:` + fmt.Sprintf("%v", this.ExitStatus) + `,`,
|
`ExitStatus:` + fmt.Sprintf("%v", this.ExitStatus) + `,`,
|
||||||
|
`ExitedAt:` + strings.Replace(strings.Replace(this.ExitedAt.String(), "Timestamp", "google_protobuf3.Timestamp", 1), `&`, ``, 1) + `,`,
|
||||||
`}`,
|
`}`,
|
||||||
}, "")
|
}, "")
|
||||||
return s
|
return s
|
||||||
@ -3360,6 +3372,36 @@ func (m *StateResponse) Unmarshal(dAtA []byte) error {
|
|||||||
break
|
break
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
case 10:
|
||||||
|
if wireType != 2 {
|
||||||
|
return fmt.Errorf("proto: wrong wireType = %d for field ExitedAt", wireType)
|
||||||
|
}
|
||||||
|
var msglen int
|
||||||
|
for shift := uint(0); ; shift += 7 {
|
||||||
|
if shift >= 64 {
|
||||||
|
return ErrIntOverflowShim
|
||||||
|
}
|
||||||
|
if iNdEx >= l {
|
||||||
|
return io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
b := dAtA[iNdEx]
|
||||||
|
iNdEx++
|
||||||
|
msglen |= (int(b) & 0x7F) << shift
|
||||||
|
if b < 0x80 {
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if msglen < 0 {
|
||||||
|
return ErrInvalidLengthShim
|
||||||
|
}
|
||||||
|
postIndex := iNdEx + msglen
|
||||||
|
if postIndex > l {
|
||||||
|
return io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.ExitedAt, dAtA[iNdEx:postIndex]); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
iNdEx = postIndex
|
||||||
default:
|
default:
|
||||||
iNdEx = preIndex
|
iNdEx = preIndex
|
||||||
skippy, err := skipShim(dAtA[iNdEx:])
|
skippy, err := skipShim(dAtA[iNdEx:])
|
||||||
@ -4340,73 +4382,73 @@ func init() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
var fileDescriptorShim = []byte{
|
var fileDescriptorShim = []byte{
|
||||||
// 1078 bytes of a gzipped FileDescriptorProto
|
// 1083 bytes of a gzipped FileDescriptorProto
|
||||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x57, 0x4f, 0x6f, 0xe3, 0x44,
|
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x57, 0x4f, 0x6f, 0x1b, 0x45,
|
||||||
0x14, 0xaf, 0xf3, 0x3f, 0x2f, 0xa4, 0xb4, 0x43, 0xb7, 0x78, 0xb3, 0x52, 0x1a, 0xf9, 0x50, 0x05,
|
0x14, 0xef, 0xfa, 0xbf, 0x9f, 0x71, 0x48, 0x86, 0x34, 0x6c, 0x5d, 0xc9, 0xb1, 0xf6, 0x10, 0x19,
|
||||||
0xa1, 0x75, 0x68, 0x8a, 0x76, 0x59, 0x90, 0x90, 0xda, 0xee, 0x0a, 0x55, 0x50, 0x6d, 0xe5, 0x76,
|
0xa1, 0xae, 0x89, 0x83, 0x5a, 0x0a, 0x12, 0x52, 0x92, 0x56, 0x28, 0x82, 0xa8, 0xd1, 0x26, 0x05,
|
||||||
0x01, 0x81, 0x50, 0xe5, 0xc6, 0xd3, 0x64, 0xd4, 0xc4, 0xe3, 0xf5, 0x8c, 0x4b, 0xcb, 0x89, 0x13,
|
0x04, 0x42, 0xd1, 0xc6, 0x3b, 0xb1, 0x47, 0xb1, 0x77, 0xb6, 0x3b, 0xb3, 0x21, 0xe1, 0xc4, 0x89,
|
||||||
0x12, 0x37, 0x3e, 0x0e, 0x1f, 0xa1, 0x47, 0x8e, 0x9c, 0x16, 0xb6, 0x12, 0x47, 0xbe, 0x03, 0x9a,
|
0x33, 0x1f, 0x87, 0x8f, 0x90, 0x03, 0x07, 0x8e, 0x9c, 0x0a, 0x8d, 0xc4, 0x91, 0xef, 0x80, 0xe6,
|
||||||
0x3f, 0x49, 0x9c, 0xa4, 0x96, 0x1d, 0x2e, 0xcd, 0xbc, 0x99, 0xdf, 0x9b, 0x79, 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33, 0x27, 0xd6, 0x1c, 0x6d, 0x21,
|
0x23, 0x1e, 0xda, 0x80, 0xd2, 0x59, 0xe4, 0x7b, 0x43, 0x6c, 0xe6, 0xc4, 0x99, 0xa3, 0x25, 0x64,
|
||||||
0x13, 0xca, 0x3a, 0x83, 0x66, 0x5e, 0x2e, 0x8c, 0x4d, 0xd4, 0x81, 0x52, 0x48, 0x29, 0xbf, 0x60,
|
0x42, 0x59, 0x47, 0xd0, 0xcc, 0xcb, 0x83, 0xb1, 0x88, 0x3a, 0x50, 0x0a, 0x29, 0xe5, 0xe7, 0xcc,
|
||||||
0x66, 0xa1, 0x95, 0x6f, 0xd7, 0xba, 0xef, 0xdb, 0xb1, 0xac, 0xcb, 0x90, 0xec, 0x23, 0x71, 0x15,
|
0x2c, 0xb4, 0xf2, 0xed, 0x5a, 0xf7, 0x7d, 0x3b, 0x16, 0x75, 0xe9, 0x92, 0x7d, 0x28, 0x9e, 0xe2,
|
||||||
0x47, 0xc3, 0x50, 0x03, 0x2a, 0x1c, 0x87, 0x23, 0xe2, 0xbb, 0x43, 0xb3, 0xd8, 0x32, 0xda, 0x15,
|
0x68, 0x18, 0x6a, 0x40, 0x85, 0xe3, 0x70, 0x44, 0x7c, 0x77, 0x68, 0x16, 0x5b, 0x46, 0xbb, 0xe2,
|
||||||
0x67, 0x62, 0xa3, 0x0d, 0x28, 0x32, 0xee, 0x11, 0xdf, 0x2c, 0xc9, 0x43, 0x94, 0x21, 0x82, 0x62,
|
0x4c, 0x64, 0xb4, 0x0e, 0x45, 0xc6, 0x3d, 0xe2, 0x9b, 0x25, 0x79, 0x89, 0x12, 0x84, 0x53, 0x8c,
|
||||||
0xdc, 0xa3, 0x11, 0x37, 0xcb, 0x2a, 0x28, 0x65, 0xe9, 0x79, 0x1c, 0x86, 0x66, 0x65, 0x32, 0x8f,
|
0x7b, 0x34, 0xe2, 0x66, 0x59, 0x39, 0xa5, 0x24, 0xbd, 0x8f, 0xc3, 0xd0, 0xac, 0x4c,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4d, 0xa5, 0x23,
|
0x25, 0xd3, 0x46, 0x84, 0x71, 0xa5, 0xfb, 0x30, 0x5e, 0x98, 0x97, 0xdb, 0xba, 0x36, 0x55, 0x1e,
|
||||||
0x47, 0x43, 0xa7, 0x8c, 0x14, 0xef, 0x67, 0xa4, 0x94, 0xc0, 0x48, 0x79, 0x86, 0x91, 0x38, 0xe7,
|
0x39, 0x1a, 0x3a, 0x65, 0xa4, 0x78, 0x37, 0x23, 0xa5, 0x04, 0x46, 0xca, 0x33, 0x8c, 0xc4, 0x39,
|
||||||
0x95, 0x39, 0xce, 0xe7, 0x24, 0x5d, 0x9d, 0x97, 0xb4, 0xf5, 0x12, 0x6a, 0x5f, 0x92, 0xe1, 0x30,
|
0xaf, 0xcc, 0x71, 0x3e, 0x97, 0xd2, 0xd5, 0xff, 0x4f, 0x69, 0x78, 0xab, 0x94, 0x7e, 0x01, 0xb5,
|
||||||
0x43, 0xa5, 0x62, 0xa4, 0x3f, 0x56, 0x55, 0xdd, 0xd1, 0x96, 0x48, 0x84, 0x3b, 0x1c, 0xca, 0x44,
|
0x2f, 0xc9, 0x70, 0x98, 0xa1, 0xd9, 0x31, 0xd2, 0x1f, 0x27, 0x66, 0xdd, 0xd1, 0x92, 0x88, 0xa5,
|
||||||
0x54, 0x1c, 0x31, 0xb4, 0x3e, 0x87, 0xd5, 0x83, 0x21, 0x65, 0xf8, 0xf0, 0x65, 0x06, 0x72, 0xd5,
|
0x3b, 0x1c, 0xca, 0x58, 0x56, 0x1c, 0xb1, 0xb4, 0x3e, 0x87, 0x95, 0xfd, 0x21, 0x65, 0xf8, 0xe0,
|
||||||
0xed, 0x95, 0x50, 0x95, 0x61, 0x7d, 0x00, 0xef, 0x7e, 0x45, 0x18, 0x3f, 0x26, 0x5e, 0xea, 0xdb,
|
0x45, 0x86, 0xfc, 0x50, 0x01, 0x54, 0xb9, 0xae, 0x04, 0xeb, 0x03, 0x78, 0xf7, 0x2b, 0xc2, 0xf8,
|
||||||
0xd8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2, 0xf7, 0xbc, 0x24, 0xb7, 0xdf, 0xfd, 0x2f, 0x00, 0x00, 0xff, 0xff, 0x53, 0xf2,
|
0xdd, 0xce, 0x72, 0xff, 0xd1, 0x7d, 0x26, 0x7e, 0xcf, 0x4a, 0xd2, 0xfc, 0xce, 0x7f, 0x01, 0x00,
|
||||||
0x71, 0x3d, 0xcc, 0x0d, 0x00, 0x00,
|
0x00, 0xff, 0xff, 0xa0, 0x05, 0x00, 0x28, 0x0f, 0x0e, 0x00, 0x00,
|
||||||
}
|
}
|
||||||
|
@ -109,6 +109,7 @@ message StateResponse {
|
|||||||
string stderr = 7;
|
string stderr = 7;
|
||||||
bool terminal = 8;
|
bool terminal = 8;
|
||||||
uint32 exit_status = 9;
|
uint32 exit_status = 9;
|
||||||
|
google.protobuf.Timestamp exited_at = 10 [(gogoproto.stdtime) = true, (gogoproto.nullable) = false];
|
||||||
}
|
}
|
||||||
|
|
||||||
message KillRequest {
|
message KillRequest {
|
||||||
|
@ -77,6 +77,7 @@ func (t *Task) State(ctx context.Context) (runtime.State, error) {
|
|||||||
Stderr: response.Stderr,
|
Stderr: response.Stderr,
|
||||||
Terminal: response.Terminal,
|
Terminal: response.Terminal,
|
||||||
ExitStatus: response.ExitStatus,
|
ExitStatus: response.ExitStatus,
|
||||||
|
ExitedAt: response.ExitedAt,
|
||||||
}, nil
|
}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2,6 +2,7 @@ package runtime
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
"time"
|
||||||
|
|
||||||
"github.com/gogo/protobuf/types"
|
"github.com/gogo/protobuf/types"
|
||||||
)
|
)
|
||||||
@ -77,10 +78,13 @@ type State struct {
|
|||||||
// Pid is the main process id for the container
|
// Pid is the main process id for the container
|
||||||
Pid uint32
|
Pid uint32
|
||||||
// ExitStatus of the process
|
// ExitStatus of the process
|
||||||
// Only vaid if the Status is Stopped
|
// Only valid if the Status is Stopped
|
||||||
ExitStatus uint32
|
ExitStatus uint32
|
||||||
Stdin string
|
// ExitedAt is the time at which the process exited
|
||||||
Stdout string
|
// Only valid if the Status is Stopped
|
||||||
Stderr string
|
ExitedAt time.Time
|
||||||
Terminal bool
|
Stdin string
|
||||||
|
Stdout string
|
||||||
|
Stderr string
|
||||||
|
Terminal bool
|
||||||
}
|
}
|
||||||
|
@ -241,6 +241,7 @@ func processFromContainerd(ctx context.Context, p runtime.Process) (*task.Proces
|
|||||||
Stderr: state.Stderr,
|
Stderr: state.Stderr,
|
||||||
Terminal: state.Terminal,
|
Terminal: state.Terminal,
|
||||||
ExitStatus: state.ExitStatus,
|
ExitStatus: state.ExitStatus,
|
||||||
|
ExitedAt: state.ExitedAt,
|
||||||
}, nil
|
}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
4
task.go
4
task.go
@ -10,6 +10,7 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
"sync"
|
"sync"
|
||||||
"syscall"
|
"syscall"
|
||||||
|
"time"
|
||||||
|
|
||||||
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"
|
||||||
@ -38,6 +39,8 @@ type Status struct {
|
|||||||
Status ProcessStatus
|
Status ProcessStatus
|
||||||
// ExitStatus returned by the process
|
// ExitStatus returned by the process
|
||||||
ExitStatus uint32
|
ExitStatus uint32
|
||||||
|
// ExitedTime is the time at which the process died
|
||||||
|
ExitTime time.Time
|
||||||
}
|
}
|
||||||
|
|
||||||
type ProcessStatus string
|
type ProcessStatus string
|
||||||
@ -194,6 +197,7 @@ func (t *task) Status(ctx context.Context) (Status, error) {
|
|||||||
return Status{
|
return Status{
|
||||||
Status: ProcessStatus(strings.ToLower(r.Process.Status.String())),
|
Status: ProcessStatus(strings.ToLower(r.Process.Status.String())),
|
||||||
ExitStatus: r.Process.ExitStatus,
|
ExitStatus: r.Process.ExitStatus,
|
||||||
|
ExitTime: r.Process.ExitedAt,
|
||||||
}, nil
|
}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -187,7 +187,7 @@ func (r *windowsRuntime) Delete(ctx context.Context, t runtime.Task) (*runtime.E
|
|||||||
rtExit = &runtime.Exit{
|
rtExit = &runtime.Exit{
|
||||||
Pid: wt.pid,
|
Pid: wt.pid,
|
||||||
Status: 255,
|
Status: 255,
|
||||||
Timestamp: time.Now(),
|
Timestamp: time.Now().UTC(),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -47,11 +47,13 @@ func (t *task) State(ctx context.Context) (runtime.State, error) {
|
|||||||
var (
|
var (
|
||||||
status runtime.Status
|
status runtime.Status
|
||||||
exitStatus uint32
|
exitStatus uint32
|
||||||
|
exitedAt time.Time
|
||||||
)
|
)
|
||||||
|
|
||||||
if p := t.getProcess(t.id); p != nil {
|
if p := t.getProcess(t.id); p != nil {
|
||||||
status = p.Status()
|
status = p.Status()
|
||||||
exitStatus = p.exitCode
|
exitStatus = p.exitCode
|
||||||
|
exitedAt = p.exitTime
|
||||||
} else {
|
} else {
|
||||||
status = t.getStatus()
|
status = t.getStatus()
|
||||||
}
|
}
|
||||||
@ -64,6 +66,7 @@ func (t *task) State(ctx context.Context) (runtime.State, error) {
|
|||||||
Stderr: t.io.src.Stderr,
|
Stderr: t.io.src.Stderr,
|
||||||
Terminal: t.io.src.Terminal,
|
Terminal: t.io.src.Terminal,
|
||||||
ExitStatus: exitStatus,
|
ExitStatus: exitStatus,
|
||||||
|
ExitedAt: exitedAt,
|
||||||
}, nil
|
}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user