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:
Niels de Vos
2024-10-25 17:24:50 +02:00
committed by mergify[bot]
parent ec1e7a4ee0
commit cea8bf8110
5 changed files with 52 additions and 10 deletions

View File

@ -212,11 +212,6 @@ func (mgr *rbdManager) GetSnapshotByID(ctx context.Context, id string) (types.Sn
}
}
// FIXME: The snapshot will have RbdImageName set to the image that was
// used as source. This is not correct for group snapshots images, and
// need to be fixed. See rbdVolume.NewSnapshotByID() for more details.
snapshot.RbdImageName = snapshot.RbdSnapName
return snapshot, nil
}