mirror of
https://github.com/ceph/ceph-csi.git
synced 2024-11-10 00:10:20 +00:00
journal: support removing multiple volumeID
Updating the code to support removing multiple volumeID's mapping from the group journal. Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
This commit is contained in:
parent
f346f3d201
commit
fc0a7d2542
@ -644,7 +644,7 @@ func (cs *ControllerServer) deleteSnapshotsAndUndoReservation(ctx context.Contex
|
|||||||
ctx,
|
ctx,
|
||||||
vgo.MetadataPool,
|
vgo.MetadataPool,
|
||||||
vgsi.ReservedID,
|
vgsi.ReservedID,
|
||||||
volID)
|
[]string{volID})
|
||||||
j.Destroy()
|
j.Destroy()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.ErrorLog(ctx, "failed to remove volume snapshot mapping: %v", err)
|
log.ErrorLog(ctx, "failed to remove volume snapshot mapping: %v", err)
|
||||||
|
@ -64,12 +64,12 @@ type VolumeGroupJournal interface {
|
|||||||
reservedUUID,
|
reservedUUID,
|
||||||
volumeID,
|
volumeID,
|
||||||
value string) error
|
value string) error
|
||||||
// RemoveVolumeMapping removes a volumeID mapping from the UUID directory.
|
// RemoveVolumeMapping removes volumeIDs mapping from the UUID directory.
|
||||||
RemoveVolumeMapping(
|
RemoveVolumeMapping(
|
||||||
ctx context.Context,
|
ctx context.Context,
|
||||||
pool,
|
pool,
|
||||||
reservedUUID,
|
reservedUUID string,
|
||||||
volumeID string) error
|
volumeIDs []string) error
|
||||||
}
|
}
|
||||||
|
|
||||||
// VolumeGroupJournalConfig contains the configuration.
|
// VolumeGroupJournalConfig contains the configuration.
|
||||||
@ -424,14 +424,14 @@ func (vgjc *VolumeGroupJournalConnection) AddVolumeMapping(
|
|||||||
func (vgjc *VolumeGroupJournalConnection) RemoveVolumeMapping(
|
func (vgjc *VolumeGroupJournalConnection) RemoveVolumeMapping(
|
||||||
ctx context.Context,
|
ctx context.Context,
|
||||||
pool,
|
pool,
|
||||||
reservedUUID,
|
reservedUUID string,
|
||||||
volumeID string,
|
volumeIDs []string,
|
||||||
) error {
|
) error {
|
||||||
err := removeMapKeys(ctx, vgjc.connection, pool, vgjc.config.namespace,
|
err := removeMapKeys(ctx, vgjc.connection, pool, vgjc.config.namespace,
|
||||||
vgjc.config.cephUUIDDirectoryPrefix+reservedUUID,
|
vgjc.config.cephUUIDDirectoryPrefix+reservedUUID,
|
||||||
[]string{volumeID})
|
volumeIDs)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.ErrorLog(ctx, "failed removing volume mapping from group: key %q: %v", volumeID, err)
|
log.ErrorLog(ctx, "failed removing volume mapping from group: key: %q %v", volumeIDs, err)
|
||||||
|
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user