mirror of
https://github.com/containers/podman.git
synced 2025-08-06 19:44:14 +08:00
code cleanup
clean up code identified as problematic by golands inspection Signed-off-by: baude <bbaude@redhat.com>
This commit is contained in:
@ -430,22 +430,17 @@ func (r *Runtime) removeContainer(ctx context.Context, c *Container, force bool,
|
||||
// If we're removing the pod, the container will be evicted
|
||||
// from the state elsewhere
|
||||
if !removePod {
|
||||
if err := r.state.RemoveContainerFromPod(pod, c); err != nil {
|
||||
if cleanupErr == nil {
|
||||
cleanupErr = err
|
||||
} else {
|
||||
logrus.Errorf("removing container from pod: %v", err)
|
||||
}
|
||||
if cleanupErr == nil {
|
||||
cleanupErr = err
|
||||
} else {
|
||||
logrus.Errorf("removing container from pod: %v", err)
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if err := r.state.RemoveContainer(c); err != nil {
|
||||
if cleanupErr == nil {
|
||||
cleanupErr = err
|
||||
} else {
|
||||
logrus.Errorf("removing container: %v", err)
|
||||
}
|
||||
cleanupErr = err
|
||||
}
|
||||
logrus.Errorf("removing container: %v", err)
|
||||
}
|
||||
|
||||
// Set container as invalid so it can no longer be used
|
||||
|
Reference in New Issue
Block a user