Skip to content

Commit 937ac8c

Browse files
author
Hou Junjie
committed
do not check waiters if mount rbd rox
1 parent cfdcce6 commit 937ac8c

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

internal/rbd/rbd_attach.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -283,17 +283,17 @@ func createPath(ctx context.Context, volOpt *rbdVolume, cr *util.Credentials) (s
283283
}
284284

285285
func waitForrbdImage(ctx context.Context, backoff wait.Backoff, volOptions *rbdVolume) error {
286-
imagePath := volOptions.String()
286+
if volOptions.DisableInUseChecks {
287+
util.UsefulLog(ctx, "valid multi-node attach requested, ignoring watcher in-use result")
288+
return nil
289+
}
287290

291+
imagePath := volOptions.String()
288292
err := wait.ExponentialBackoff(backoff, func() (bool, error) {
289293
used, err := volOptions.isInUse()
290294
if err != nil {
291295
return false, fmt.Errorf("fail to check rbd image status: (%w)", err)
292296
}
293-
if (volOptions.DisableInUseChecks) && (used) {
294-
util.UsefulLog(ctx, "valid multi-node attach requested, ignoring watcher in-use result")
295-
return used, nil
296-
}
297297
return !used, nil
298298
})
299299
// return error if rbd image has not become available for the specified timeout

internal/util/validate.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ func CheckReadOnlyManyIsSupported(req *csi.CreateVolumeRequest) error {
9090
writable = true
9191
}
9292
}
93-
if ! writable && req.GetVolumeContentSource() == nil {
93+
if !writable && req.GetVolumeContentSource() == nil {
9494
return status.Error(codes.InvalidArgument, "readOnly accessMode is supported only with content source")
9595
}
9696
return nil

0 commit comments

Comments
 (0)