Skip to content

Commit 6ba791d

Browse files
cleanup: move Destroy() method to journalledObject interface
VolumeGroup interface has more than 10 methods and it causes golangci-lint to fail. Moving the `Destroy()` method to a base interface journalledObject. Signed-off-by: Praveen M <m.praveen@ibm.com>
1 parent 306c5c2 commit 6ba791d

File tree

4 files changed

+3
-12
lines changed

4 files changed

+3
-12
lines changed

internal/rbd/types/group.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,15 +37,15 @@ type journalledObject interface {
3737

3838
// GetClusterID returns the ID of the cluster of the object.
3939
GetClusterID(ctx context.Context) (string, error)
40+
41+
// Destroy frees the resources used by the object.
42+
Destroy(ctx context.Context)
4043
}
4144

4245
// VolumeGroup contains a number of volumes.
4346
type VolumeGroup interface {
4447
journalledObject
4548

46-
// Destroy frees the resources used by the VolumeGroup.
47-
Destroy(ctx context.Context)
48-
4949
// GetIOContext returns the IOContext for performing librbd operations
5050
// on the VolumeGroup. This is used by the rbdVolume struct when it
5151
// needs to add/remove itself from the VolumeGroup.

internal/rbd/types/snapshot.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,6 @@ import (
2828
type Snapshot interface {
2929
journalledObject
3030

31-
// Destroy frees the resources used by the Snapshot.
32-
Destroy(ctx context.Context)
33-
3431
// Delete removes the snapshot from the storage backend.
3532
Delete(ctx context.Context) error
3633

internal/rbd/types/volume.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,9 +67,6 @@ type Volume interface {
6767
snapshottableVolume
6868
csiAddonsVolume
6969

70-
// Destroy frees the resources used by the Volume.
71-
Destroy(ctx context.Context)
72-
7370
// Delete removes the volume from the storage backend.
7471
Delete(ctx context.Context) error
7572

internal/rbd/types/volume_group_snapshot.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,6 @@ import (
2929
type VolumeGroupSnapshot interface {
3030
journalledObject
3131

32-
// Destroy frees the resources used by the VolumeGroupSnapshot.
33-
Destroy(ctx context.Context)
34-
3532
// Delete removes the VolumeGroupSnapshot from the storage backend.
3633
Delete(ctx context.Context) error
3734

0 commit comments

Comments
 (0)