mirror of
https://github.com/ceph/ceph-csi.git
synced 2025-06-14 18:53:35 +00:00
Add multiNodeWritable option for RBD Volumes
This change adds the ability to define a `multiNodeWritable` option in the Storage Class. This change does a number of things: 1. Allow multi-node-multi-writer access modes if the SC options is enabled 2. Bypass the watcher checks for MultiNodeMultiWriter Volumes 3. Maintains existing watcher checks for SingleNodeWriter access modes regardless of the StorageClass option. fix lint-errors
This commit is contained in:
@ -313,8 +313,16 @@ func waitForrbdImage(backoff wait.Backoff, volOptions *rbdVolume, userID string,
|
||||
if err != nil {
|
||||
return false, fmt.Errorf("fail to check rbd image status with: (%v), rbd output: (%s)", err, rbdOutput)
|
||||
}
|
||||
// In the case of multiattach we want to short circuit the retries when used (so r`if used; return used`)
|
||||
// otherwise we're setting this to false which translates to !ok, which means backoff and try again
|
||||
// NOTE: we ONLY do this if an multi-node access mode is requested for this volume
|
||||
if (strings.ToLower(volOptions.MultiNodeWritable) == "enabled") && (used) {
|
||||
klog.V(2).Info("detected MultiNodeWritable enabled, ignoring watcher in-use result")
|
||||
return used, nil
|
||||
}
|
||||
return !used, nil
|
||||
})
|
||||
|
||||
// return error if rbd image has not become available for the specified timeout
|
||||
if err == wait.ErrWaitTimeout {
|
||||
return fmt.Errorf("rbd image %s is still being used", imagePath)
|
||||
|
Reference in New Issue
Block a user