Merge pull request #10000 from rhatdan/cleanup

Do not delete container twice
This commit is contained in:
OpenShift Merge Robot 2021-04-13 16:33:12 +02:00 committed by GitHub
commit 21d6b12689
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 0 additions and 14 deletions

View File

@ -616,20 +616,6 @@ func (r *Runtime) removeContainer(ctx context.Context, c *Container, force, remo
}
}
// Delete the container.
// Not needed in Configured and Exited states, where the container
// doesn't exist in the runtime
if c.state.State != define.ContainerStateConfigured &&
c.state.State != define.ContainerStateExited {
if err := c.delete(ctx); err != nil {
if cleanupErr == nil {
cleanupErr = err
} else {
logrus.Errorf("delete container: %v", err)
}
}
}
// Remove the container from the state
if c.config.Pod != "" {
// If we're removing the pod, the container will be evicted