mirror of
https://github.com/ceph/ceph-csi.git
synced 2025-06-14 02:43:36 +00:00
cleanup: move ErrImageNotFound from rbd/errors to util/errors
Signed-off-by: Praveen M <m.praveen@ibm.com>
This commit is contained in:
@ -174,7 +174,7 @@ func (mgr *rbdManager) GetVolumeByID(ctx context.Context, id string) (types.Volu
|
||||
volume, err := GenVolFromVolID(ctx, id, creds, mgr.secrets)
|
||||
if err != nil {
|
||||
switch {
|
||||
case errors.Is(err, ErrImageNotFound):
|
||||
case errors.Is(err, util.ErrImageNotFound):
|
||||
err = fmt.Errorf("volume %s not found: %w", id, err)
|
||||
|
||||
return nil, err
|
||||
@ -199,7 +199,7 @@ func (mgr *rbdManager) GetSnapshotByID(ctx context.Context, id string) (types.Sn
|
||||
snapshot, err := genSnapFromSnapID(ctx, id, creds, mgr.secrets)
|
||||
if err != nil {
|
||||
switch {
|
||||
case errors.Is(err, ErrImageNotFound):
|
||||
case errors.Is(err, util.ErrImageNotFound):
|
||||
err = fmt.Errorf("volume %s not found: %w", id, err)
|
||||
|
||||
return nil, err
|
||||
@ -467,7 +467,7 @@ func (mgr *rbdManager) CreateVolumeGroupSnapshot(
|
||||
|
||||
return vgs, nil
|
||||
}
|
||||
} else if err != nil && !errors.Is(ErrImageNotFound, err) {
|
||||
} else if err != nil && !errors.Is(err, util.ErrImageNotFound) {
|
||||
// ErrImageNotFound can be returned if the VolumeGroupSnapshot
|
||||
// could not be found. It is expected that it does not exist
|
||||
// yet, in which case it will be created below.
|
||||
|
Reference in New Issue
Block a user