Skip to content

Commit

Permalink
do not check waiters if mount rbd rox
Browse files Browse the repository at this point in the history
  • Loading branch information
Hou Junjie committed Jul 16, 2021
1 parent cfdcce6 commit 937ac8c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions internal/rbd/rbd_attach.go
Original file line number Diff line number Diff line change
Expand Up @@ -283,17 +283,17 @@ func createPath(ctx context.Context, volOpt *rbdVolume, cr *util.Credentials) (s
}

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

imagePath := volOptions.String()
err := wait.ExponentialBackoff(backoff, func() (bool, error) {
used, err := volOptions.isInUse()
if err != nil {
return false, fmt.Errorf("fail to check rbd image status: (%w)", err)
}
if (volOptions.DisableInUseChecks) && (used) {
util.UsefulLog(ctx, "valid multi-node attach requested, ignoring watcher in-use result")
return used, nil
}
return !used, nil
})
// return error if rbd image has not become available for the specified timeout
Expand Down
2 changes: 1 addition & 1 deletion internal/util/validate.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ func CheckReadOnlyManyIsSupported(req *csi.CreateVolumeRequest) error {
writable = true
}
}
if ! writable && req.GetVolumeContentSource() == nil {
if !writable && req.GetVolumeContentSource() == nil {
return status.Error(codes.InvalidArgument, "readOnly accessMode is supported only with content source")
}
return nil
Expand Down

0 comments on commit 937ac8c

Please sign in to comment.