mirror of
https://github.com/ceph/ceph-csi.git
synced 2025-01-05 11:39:29 +00:00
cleanup: use err
and target
in recommended order to errors.Is()
The documentation has `error.Is(err, target)`, so use this as the order of the parameters. Signed-off-by: Niels de Vos <ndevos@ibm.com>
This commit is contained in:
parent
3802dd2c2c
commit
e154eae732
@ -187,7 +187,7 @@ func (vg *volumeGroup) Delete(ctx context.Context) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
err = librbd.GroupRemove(ioctx, name)
|
err = librbd.GroupRemove(ioctx, name)
|
||||||
if err != nil && !errors.Is(rados.ErrNotFound, err) {
|
if err != nil && !errors.Is(err, rados.ErrNotFound) {
|
||||||
return fmt.Errorf("failed to remove volume group %q: %w", vg, err)
|
return fmt.Errorf("failed to remove volume group %q: %w", vg, err)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -245,7 +245,7 @@ func (vg *volumeGroup) RemoveVolume(ctx context.Context, vol types.Volume) error
|
|||||||
|
|
||||||
err := vol.RemoveFromGroup(ctx, vg)
|
err := vol.RemoveFromGroup(ctx, vg)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
if errors.Is(librbd.ErrNotExist, err) {
|
if errors.Is(err, librbd.ErrNotExist) {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user