Change Exited/Status to SetExited/ExitStatus
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
This commit is contained in:
parent
a2a3451925
commit
9f08965699
@ -76,7 +76,7 @@ func (e *execProcess) Pid() int {
|
||||
return e.pid
|
||||
}
|
||||
|
||||
func (e *execProcess) Status() int {
|
||||
func (e *execProcess) ExitStatus() int {
|
||||
return e.status
|
||||
}
|
||||
|
||||
@ -84,7 +84,7 @@ func (e *execProcess) ExitedAt() time.Time {
|
||||
return e.exited
|
||||
}
|
||||
|
||||
func (e *execProcess) Exited(status int) {
|
||||
func (e *execProcess) SetExited(status int) {
|
||||
e.status = status
|
||||
e.exited = time.Now()
|
||||
e.parent.platform.shutdownConsole(context.Background(), e.console)
|
||||
|
@ -201,7 +201,7 @@ func (p *initProcess) Pid() int {
|
||||
return p.pid
|
||||
}
|
||||
|
||||
func (p *initProcess) Status() int {
|
||||
func (p *initProcess) ExitStatus() int {
|
||||
return p.status
|
||||
}
|
||||
|
||||
@ -225,7 +225,7 @@ func (p *initProcess) Start(context context.Context) error {
|
||||
return p.runtimeError(err, "OCI runtime start failed")
|
||||
}
|
||||
|
||||
func (p *initProcess) Exited(status int) {
|
||||
func (p *initProcess) SetExited(status int) {
|
||||
p.mu.Lock()
|
||||
p.status = status
|
||||
p.exited = time.Now()
|
||||
|
@ -24,10 +24,10 @@ type process interface {
|
||||
Pid() int
|
||||
// Resize resizes the process console
|
||||
Resize(ws console.WinSize) error
|
||||
// Exited sets the exit status for the process
|
||||
Exited(status int)
|
||||
// Status returns the exit status
|
||||
Status() int
|
||||
// SetExited sets the exit status for the process
|
||||
SetExited(status int)
|
||||
// ExitStatus returns the exit status
|
||||
ExitStatus() int
|
||||
// ExitedAt is the time the process exited
|
||||
ExitedAt() time.Time
|
||||
// Delete deletes the process and its resourcess
|
||||
|
@ -152,12 +152,12 @@ func (s *Service) Delete(ctx context.Context, r *google_protobuf.Empty) (*shimap
|
||||
s.mu.Unlock()
|
||||
s.events <- &eventsapi.TaskDelete{
|
||||
ContainerID: s.id,
|
||||
ExitStatus: uint32(p.Status()),
|
||||
ExitStatus: uint32(p.ExitStatus()),
|
||||
ExitedAt: p.ExitedAt(),
|
||||
Pid: uint32(p.Pid()),
|
||||
}
|
||||
return &shimapi.DeleteResponse{
|
||||
ExitStatus: uint32(p.Status()),
|
||||
ExitStatus: uint32(p.ExitStatus()),
|
||||
ExitedAt: p.ExitedAt(),
|
||||
Pid: uint32(p.Pid()),
|
||||
}, nil
|
||||
@ -182,7 +182,7 @@ func (s *Service) DeleteProcess(ctx context.Context, r *shimapi.DeleteProcessReq
|
||||
delete(s.processes, p.ID())
|
||||
s.mu.Unlock()
|
||||
return &shimapi.DeleteResponse{
|
||||
ExitStatus: uint32(p.Status()),
|
||||
ExitStatus: uint32(p.ExitStatus()),
|
||||
ExitedAt: p.ExitedAt(),
|
||||
Pid: uint32(p.Pid()),
|
||||
}, nil
|
||||
@ -362,7 +362,7 @@ func (s *Service) Update(ctx context.Context, r *shimapi.UpdateTaskRequest) (*go
|
||||
|
||||
func (s *Service) waitExit(p process, pid int, cmd *reaper.Cmd) {
|
||||
status := <-cmd.ExitCh
|
||||
p.Exited(status)
|
||||
p.SetExited(status)
|
||||
|
||||
reaper.Default.Delete(pid)
|
||||
s.events <- &eventsapi.TaskExit{
|
||||
|
Loading…
Reference in New Issue
Block a user