libpod: remove duplicated HasVolume() check

removeVolume() already does the same check so we do not need it twice.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
This commit is contained in:
Paul Holzinger
2024-08-14 12:00:45 +02:00
parent a65aecd260
commit 94fd5fe6f7

View File

@ -28,13 +28,6 @@ func (r *Runtime) RemoveVolume(ctx context.Context, v *Volume, force bool, timeo
return define.ErrRuntimeStopped
}
if !v.valid {
if ok, _ := r.state.HasVolume(v.Name()); !ok {
// Volume probably already removed
// Or was never in the runtime to begin with
return nil
}
}
return r.removeVolume(ctx, v, force, timeout, false)
}