cleanup: move internal/rbd/errors.go to internal/rbd/errors pacakge

Signed-off-by: Praveen M <m.praveen@ibm.com>
(cherry picked from commit 5cbc14454a)

# Conflicts:
#	internal/csi-addons/rbd/encryptionkeyrotation.go
#	internal/csi-addons/rbd/reclaimspace.go
#	internal/csi-addons/rbd/replication.go
#	internal/csi-addons/rbd/replication_test.go
#	internal/rbd/clone.go
#	internal/rbd/controllerserver.go
#	internal/rbd/group/util.go
#	internal/rbd/group/util_test.go
#	internal/rbd/manager.go
#	internal/rbd/rbd_journal.go
#	internal/rbd/rbd_util.go
#	internal/rbd/rbd_util_test.go
#	internal/rbd/snapshot.go
#	internal/util/errors.go
This commit is contained in:
Praveen M
2025-03-03 11:45:43 +05:30
committed by Mergify
parent 7cff156d9a
commit 4dcb9d3a45
24 changed files with 632 additions and 63 deletions

View File

@ -24,6 +24,7 @@ import (
"github.com/container-storage-interface/spec/lib/go/csi"
"google.golang.org/protobuf/types/known/timestamppb"
rbderrors "github.com/ceph/ceph-csi/internal/rbd/errors"
"github.com/ceph/ceph-csi/internal/rbd/types"
"github.com/ceph/ceph-csi/internal/util"
"github.com/ceph/ceph-csi/internal/util/log"
@ -82,7 +83,11 @@ func cleanUpSnapshot(
) error {
err := parentVol.deleteSnapshot(ctx, rbdSnap)
if err != nil {
<<<<<<< HEAD
if !errors.Is(err, ErrImageNotFound) && !errors.Is(err, ErrSnapNotFound) {
=======
if !errors.Is(err, rbderrors.ErrImageNotFound) && !errors.Is(err, rbderrors.ErrSnapNotFound) {
>>>>>>> 5cbc1445 (cleanup: move internal/rbd/errors.go to internal/rbd/errors pacakge)
log.ErrorLog(ctx, "failed to delete snapshot %q: %v", rbdSnap, err)
return err
@ -92,7 +97,11 @@ func cleanUpSnapshot(
if rbdVol != nil {
err := rbdVol.Delete(ctx)
if err != nil {
<<<<<<< HEAD
if !errors.Is(err, ErrImageNotFound) {
=======
if !errors.Is(err, rbderrors.ErrImageNotFound) {
>>>>>>> 5cbc1445 (cleanup: move internal/rbd/errors.go to internal/rbd/errors pacakge)
log.ErrorLog(ctx, "failed to delete rbd image %q with error: %v", rbdVol, err)
return err