mirror of
https://github.com/ceph/ceph-csi.git
synced 2024-11-17 20:00:23 +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)
|
||||
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)
|
||||
}
|
||||
|
||||
@ -245,7 +245,7 @@ func (vg *volumeGroup) RemoveVolume(ctx context.Context, vol types.Volume) error
|
||||
|
||||
err := vol.RemoveFromGroup(ctx, vg)
|
||||
if err != nil {
|
||||
if errors.Is(librbd.ErrNotExist, err) {
|
||||
if errors.Is(err, librbd.ErrNotExist) {
|
||||
return nil
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user