Skip to content

Commit

Permalink
rbd: fix arguments have the wrong order (staticcheck)
Browse files Browse the repository at this point in the history
Signed-off-by: Praveen M <[email protected]>
  • Loading branch information
iPraveenParihar committed Dec 20, 2024
1 parent d750f21 commit ee5dc32
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions internal/rbd/snapshot.go
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ func (rv *rbdVolume) NewSnapshotByID(
log.DebugLog(ctx, "going to clone snapshot image %q from image %q with snapshot ID %d", snap, rv, id)

err = librbd.CloneImageByID(rv.ioctx, rv.RbdImageName, id, rv.ioctx, snap.RbdImageName, options)
if err != nil && !errors.Is(librbd.ErrExist, err) {
if err != nil && !errors.Is(err, librbd.ErrExist) {
log.ErrorLog(ctx, "failed to clone snapshot %q with id %d: %v", snap, id, err)

return nil, fmt.Errorf("failed to clone %q with snapshot id %d as new image %q: %w", rv.RbdImageName, id, snap, err)
Expand Down Expand Up @@ -342,7 +342,7 @@ func (rv *rbdVolume) NewSnapshotByID(
defer image.Close()

snapImage, err = image.CreateSnapshot(snap.RbdSnapName)
if err != nil && !errors.Is(librbd.ErrExist, err) {
if err != nil && !errors.Is(err, librbd.ErrExist) {
return nil, fmt.Errorf("failed to create snapshot on image %q: %w", snap, err)
}

Expand Down

0 comments on commit ee5dc32

Please sign in to comment.