diff --git a/internal/rbd/group/group_snapshot.go b/internal/rbd/group/group_snapshot.go index 5de8b616396d..3c30e208c99e 100644 --- a/internal/rbd/group/group_snapshot.go +++ b/internal/rbd/group/group_snapshot.go @@ -32,24 +32,21 @@ import ( type volumeGroupSnapshot struct { commonVolumeGroup - // volumes is a list of rbd-images that are part of the group. The ID - // of each volume is stored in the journal. + // snapshots is a list of rbd-images that are part of the group. The ID + // of each snapshot is stored in the journal. snapshots []types.Snapshot - // volumeToFree contains Volumes that were resolved during - // GetVolumeGroup. The volumes slice can be updated independently of - // this by calling AddVolume (Volumes are allocated elsewhere), and - // RemoveVolume (need to keep track of the allocated Volume). + // snapshotsToFree contains Snapshots that were resolved during + // GetVolumeGroupSnapshot. snapshotsToFree []types.Snapshot } // verify that volumeGroupSnapshot implements the VolumeGroupSnapshot interface. var _ types.VolumeGroupSnapshot = &volumeGroupSnapshot{} -// GetVolumeGroupSnapshot initializes a new VolumeGroup object that can be used -// to manage an `rbd group`. -// If the .GetName() function returns an error, the VolumeGroup does not exist -// yet. It is needed to call .Create() in that case first. +// GetVolumeGroupSnapshot initializes a new VolumeGroupSnapshot object that can +// be used to inspect and delete a group of snapshots that was created by a +// VolumeGroup. func GetVolumeGroupSnapshot( ctx context.Context, id string, @@ -113,6 +110,8 @@ func GetVolumeGroupSnapshot( return vgs, nil } +// NewVolumeGroupSnapshot creates a new VolumeGroupSnapshot object with the +// given slice of Snapshots and adds the objectmapping to the journal. func NewVolumeGroupSnapshot( ctx context.Context, id string, @@ -175,7 +174,7 @@ func NewVolumeGroupSnapshot( return vgs, nil } -// ToCSI creates a CSI-Addons type for the VolumeGroup. +// ToCSI creates a CSI-Addons type for the VolumeGroupSnapshot. func (vgs *volumeGroupSnapshot) ToCSI(ctx context.Context) (*csi.VolumeGroupSnapshot, error) { snapshots, err := vgs.ListSnapshots(ctx) if err != nil {