Skip to content

Commit

Permalink
Merge pull request #14765 from giuseppe/unpause-before-kill
Browse files Browse the repository at this point in the history
runtime: unpause the container before killing it
  • Loading branch information
openshift-ci[bot] authored Jun 29, 2022
2 parents 653e87d + 1affceb commit 4608b8b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions libpod/runtime_ctr.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 4608b8b

Please sign in to comment.