mirror of
https://github.com/opencontainers/runc.git
synced 2026-04-22 23:17:17 +08:00
runc delete: do not ignore error from destroy
If container.Destroy() has failed, runc destroy still return 0, which is wrong and can result in other issues down the line. Let's always return error from destroy in runc delete. For runc checkpoint and runc run, we still treat it as a warning. Co-authored-by: Zhang Tianyang <burning9699@gmail.com> Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
This commit is contained in:
@@ -874,7 +874,10 @@ func (c *Container) newInitConfig(process *Process) *initConfig {
|
||||
func (c *Container) Destroy() error {
|
||||
c.m.Lock()
|
||||
defer c.m.Unlock()
|
||||
return c.state.destroy()
|
||||
if err := c.state.destroy(); err != nil {
|
||||
return fmt.Errorf("unable to destroy container: %w", err)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// Pause pauses the container, if its state is RUNNING or CREATED, changing
|
||||
|
||||
Reference in New Issue
Block a user