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>
This commit is contained in:
Praveen M 2025-03-04 15:40:39 +05:30
parent c429894704
commit 813266fe29
4 changed files with 3 additions and 12 deletions

View File

@ -37,15 +37,15 @@ type journalledObject interface {
// GetClusterID returns the ID of the cluster of the object. // GetClusterID returns the ID of the cluster of the object.
GetClusterID(ctx context.Context) (string, error) GetClusterID(ctx context.Context) (string, error)
// Destroy frees the resources used by the VolumeGroup.
Destroy(ctx context.Context)
} }
// VolumeGroup contains a number of volumes. // VolumeGroup contains a number of volumes.
type VolumeGroup interface { type VolumeGroup interface {
journalledObject journalledObject
// Destroy frees the resources used by the VolumeGroup.
Destroy(ctx context.Context)
// GetIOContext returns the IOContext for performing librbd operations // GetIOContext returns the IOContext for performing librbd operations
// on the VolumeGroup. This is used by the rbdVolume struct when it // on the VolumeGroup. This is used by the rbdVolume struct when it
// needs to add/remove itself from the VolumeGroup. // needs to add/remove itself from the VolumeGroup.

View File

@ -28,9 +28,6 @@ import (
type Snapshot interface { type Snapshot interface {
journalledObject journalledObject
// Destroy frees the resources used by the Snapshot.
Destroy(ctx context.Context)
// Delete removes the snapshot from the storage backend. // Delete removes the snapshot from the storage backend.
Delete(ctx context.Context) error Delete(ctx context.Context) error

View File

@ -67,9 +67,6 @@ type Volume interface {
snapshottableVolume snapshottableVolume
csiAddonsVolume csiAddonsVolume
// Destroy frees the resources used by the Volume.
Destroy(ctx context.Context)
// Delete removes the volume from the storage backend. // Delete removes the volume from the storage backend.
Delete(ctx context.Context) error Delete(ctx context.Context) error

View File

@ -29,9 +29,6 @@ import (
type VolumeGroupSnapshot interface { type VolumeGroupSnapshot interface {
journalledObject journalledObject
// Destroy frees the resources used by the VolumeGroupSnapshot.
Destroy(ctx context.Context)
// Delete removes the VolumeGroupSnapshot from the storage backend. // Delete removes the VolumeGroupSnapshot from the storage backend.
Delete(ctx context.Context) error Delete(ctx context.Context) error