mirror of
https://github.com/ceph/ceph-csi.git
synced 2024-11-21 13:50:20 +00:00
journal: store csi.groupid
for snapshots
Commit95733b3a9
introduced the `StoreGroupID()` function, but that unfortunately set an empty key in the journal. Passing the `csiGroupIDKey` key (with value `csi.groupid`) caused setting `csi.csi.groupid` as a key. Reading the value back with the right `csi.groupid` key always returned an empty value. Fixes:95733b3a9
"journal: add option to store the groupID" Signed-off-by: Niels de Vos <ndevos@ibm.com>
This commit is contained in:
parent
6d88e0a4c7
commit
5d5171c7d7
@ -199,6 +199,7 @@ func NewCSISnapshotJournal(suffix string) *Config {
|
||||
cephSnapSourceKey: "csi.source",
|
||||
namespace: "",
|
||||
csiImageIDKey: "csi.imageid",
|
||||
csiGroupIDKey: "csi.groupid",
|
||||
encryptKMSKey: "csi.volume.encryptKMS",
|
||||
encryptionType: "csi.volume.encryptionType",
|
||||
ownerKey: "csi.volume.owner",
|
||||
@ -805,7 +806,8 @@ func (conn *Connection) StoreAttribute(ctx context.Context, pool, reservedUUID,
|
||||
|
||||
// StoreGroupID stores an groupID in omap.
|
||||
func (conn *Connection) StoreGroupID(ctx context.Context, pool, reservedUUID, groupID string) error {
|
||||
err := conn.StoreAttribute(ctx, pool, reservedUUID, conn.config.csiGroupIDKey, groupID)
|
||||
err := setOMapKeys(ctx, conn, pool, conn.config.namespace, conn.config.cephUUIDDirectoryPrefix+reservedUUID,
|
||||
map[string]string{conn.config.csiGroupIDKey: groupID})
|
||||
if err != nil {
|
||||
return fmt.Errorf("failed to store groupID %w", err)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user