Merge pull request #14765 from giuseppe/unpause-before-kill

runtime: unpause the container before killing it
This commit is contained in:
openshift-ci[bot]
2022-06-29 06:44:21 +00:00
committed by GitHub

View File

@ -664,9 +664,6 @@ func (r *Runtime) removeContainer(ctx context.Context, c *Container, force, remo
}
if c.state.State == define.ContainerStatePaused {
if err := c.ociRuntime.KillContainer(c, 9, false); err != nil {
return err
}
isV2, err := cgroups.IsCgroup2UnifiedMode()
if err != nil {
return err
@ -677,6 +674,9 @@ func (r *Runtime) removeContainer(ctx context.Context, c *Container, force, remo
return err
}
}
if err := c.ociRuntime.KillContainer(c, 9, false); err != nil {
return err
}
// Need to update container state to make sure we know it's stopped
if err := c.waitForExitFileAndSync(); err != nil {
return err