@@ -310,7 +310,7 @@ func (conn *Connection) CheckReservation(ctx context.Context,
310
310
}
311
311
objUUIDAndPool , found := values [cj .csiNameKeyPrefix + reqName ]
312
312
if ! found {
313
- // oamp was read but was missing the desired key-value pair
313
+ // omap was read but was missing the desired key-value pair
314
314
// stop processing but without an error for no reservation exists
315
315
return nil , nil
316
316
}
@@ -459,9 +459,9 @@ func (conn *Connection) UndoReservation(ctx context.Context,
459
459
// reserveOMapName creates an omap with passed in oMapNamePrefix and a
460
460
// generated <uuid>. If the passed volUUID is not empty it will use it instead
461
461
// of generating its own UUID and it will return an error immediately if omap
462
- // already exists.if the passed volUUID is empty It ensures generated omap name
462
+ // already exists. If the passed volUUID is empty, it ensures generated omap name
463
463
// does not already exist and if conflicts are detected, a set number of
464
- // retires with newer uuids are attempted before returning an error.
464
+ // retries with newer uuids are attempted before returning an error.
465
465
func reserveOMapName (
466
466
ctx context.Context ,
467
467
monitors string ,
@@ -482,7 +482,7 @@ func reserveOMapName(
482
482
err := util .CreateObject (ctx , monitors , cr , pool , namespace , oMapNamePrefix + iterUUID )
483
483
if err != nil {
484
484
// if the volUUID is empty continue with retry as consumer of this
485
- // function doesn 't requested to create object with specific value.
485
+ // function didn 't request to create object with specific value.
486
486
if volUUID == "" && errors .Is (err , util .ErrObjectExists ) {
487
487
attempt ++
488
488
// try again with a different uuid, for maxAttempts tries
@@ -514,16 +514,15 @@ held, to prevent parallel operations from modifying the state of the omaps for t
514
514
515
515
Input arguments:
516
516
- journalPool: Pool where the CSI journal is stored (maybe different than the pool where the
517
- image/subvolume is created duw to topology constraints)
517
+ image/subvolume is created due to topology constraints)
518
518
- journalPoolID: pool ID of the journalPool
519
519
- imagePool: Pool where the image/subvolume is created
520
520
- imagePoolID: pool ID of the imagePool
521
521
- reqName: Name of the volume request received
522
- - namePrefix: Prefix to use when generating the image/subvolume name (suffix is an auto-genetated UUID)
522
+ - namePrefix: Prefix to use when generating the image/subvolume name (suffix is an auto-generated UUID)
523
523
- parentName: Name of the parent image/subvolume if reservation is for a snapshot (optional)
524
524
- kmsConf: Name of the key management service used to encrypt the image (optional)
525
- - volUUID: UUID need to be reserved instead of auto-generating one (this is
526
- useful for mirroring and metro-DR)
525
+ - volUUID: UUID need to be reserved instead of auto-generating one (this is useful for mirroring and metro-DR)
527
526
- owner: the owner of the volume (optional)
528
527
529
528
Return values:
@@ -581,6 +580,9 @@ func (conn *Connection) ReserveName(ctx context.Context,
581
580
nameKeyVal = volUUID
582
581
}
583
582
583
+ // After generating the UUID Directory omap, we populate the csiDirectory
584
+ // omap with a key-value entry to map the request to the backend volume:
585
+ // `csiNameKeyPrefix + reqName: nameKeyVal`
584
586
err = setOMapKeys (ctx , conn , journalPool , cj .namespace , cj .csiDirectory ,
585
587
map [string ]string {cj .csiNameKeyPrefix + reqName : nameKeyVal })
586
588
if err != nil {
0 commit comments