mirror of
https://github.com/containers/podman.git
synced 2025-10-18 03:33:32 +08:00
Rework state tests to avoid boilerplate. Begin adding pod tests.
Signed-off-by: Matthew Heon <matthew.heon@gmail.com> Closes: #268 Approved by: rhatdan
This commit is contained in:
@ -121,8 +121,9 @@ func (r *Runtime) removeContainer(c *Container, force bool) error {
|
||||
// We need to lock the pod before we lock the container
|
||||
// To avoid races around removing a container and the pod it is in
|
||||
var pod *Pod
|
||||
var err error
|
||||
if c.config.Pod != "" {
|
||||
pod, err := r.state.Pod(c.config.Pod)
|
||||
pod, err = r.state.Pod(c.config.Pod)
|
||||
if err != nil {
|
||||
return errors.Wrapf(err, "container %s is in pod %s, but pod cannot be retrieved", c.ID(), pod.ID())
|
||||
}
|
||||
|
Reference in New Issue
Block a user