mirror of
https://github.com/ceph/ceph-csi.git
synced 2025-06-13 10:33:35 +00:00
rbd: set SnapshotGroupID on each Snapshot of a VolumeGroupSnapshot
Without the SnapshotGroupID in the Snapshot object, Kubernetes CSI does not know that the Snapshot belongs to a group. In that case, it allows the deletion of the Snapshot, which should be denied. Signed-off-by: Niels de Vos <ndevos@ibm.com>
This commit is contained in:
committed by
mergify[bot]
parent
ec1e7a4ee0
commit
cea8bf8110
@ -155,6 +155,12 @@ func NewVolumeGroupSnapshot(
|
||||
}
|
||||
|
||||
volumeMap[handle] = name
|
||||
|
||||
// store the CSI ID of the group in the snapshot attributes
|
||||
snapErr = snapshot.SetVolumeGroup(ctx, creds, vgs.id)
|
||||
if snapErr != nil {
|
||||
return nil, fmt.Errorf("failed to set volume group ID %q for snapshot %q: %w", vgs.id, name, snapErr)
|
||||
}
|
||||
}
|
||||
|
||||
j, err := vgs.getJournal(ctx)
|
||||
|
Reference in New Issue
Block a user