Merge pull request #44892 from corhere/backport-23.0/fix-kata-exec-exit
[23.0 backport] Fix exit-event handling for Kata runtime
This commit is contained in:
commit
bacf32d9ab
2 changed files with 5 additions and 2 deletions
|
@ -148,7 +148,7 @@ func (daemon *Daemon) ProcessEvent(id string, e libcontainerdtypes.EventType, ei
|
|||
|
||||
daemon.LogContainerEvent(c, "oom")
|
||||
case libcontainerdtypes.EventExit:
|
||||
if int(ei.Pid) == c.Pid {
|
||||
if ei.ProcessID == libcontainerdtypes.InitProcessName {
|
||||
return daemon.handleContainerExit(c, &ei)
|
||||
}
|
||||
|
||||
|
|
|
@ -674,7 +674,7 @@ func (c *client) processEvent(ctx context.Context, et libcontainerdtypes.EventTy
|
|||
}).Error("failed to process event")
|
||||
}
|
||||
|
||||
if et == libcontainerdtypes.EventExit && ei.ProcessID != ei.ContainerID {
|
||||
if et == libcontainerdtypes.EventExit && ei.ProcessID != libcontainerdtypes.InitProcessName {
|
||||
p, err := c.getProcess(ctx, ei.ContainerID, ei.ProcessID)
|
||||
if err != nil {
|
||||
|
||||
|
@ -823,6 +823,9 @@ func (c *client) processEventStream(ctx context.Context, ns string) {
|
|||
ExitCode: t.ExitStatus,
|
||||
ExitedAt: t.ExitedAt,
|
||||
}
|
||||
if t.ID == t.ContainerID {
|
||||
ei.ProcessID = libcontainerdtypes.InitProcessName
|
||||
}
|
||||
case *apievents.TaskOOM:
|
||||
et = libcontainerdtypes.EventOOM
|
||||
ei = libcontainerdtypes.EventInfo{
|
||||
|
|
Loading…
Reference in a new issue