Merge pull request #62168 from piontec/hotfix/fix-rbd-nbd

Automatic merge from submit-queue (batch tested with PRs 62043, 62168). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

fix typo that redefines variable and breaks code

**What this PR does / why we need it**:
Fixes bug in `rbd_util.go`, where a variable is overriden in `if` scope.

**Which issue(s) this PR fixes**
Fixes #32266

**Special notes for your reviewer**:
This is related to the PR: https://github.com/kubernetes/kubernetes/pull/58916 This can not work, as the variable `nbdToolsFound` is changed only in local scope of `if` and is always `false` outside.

**Release note**:
```release-note
Fixes bug in rbd-nbd utility when rbd is used.
```
This commit is contained in:
Kubernetes Submit Queue 2018-04-05 09:07:07 -07:00 committed by GitHub
commit 051195be12
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -374,7 +374,7 @@ func (util *RBDUtil) AttachDisk(b rbdMounter) (string, error) {
nbdToolsFound := false
if !mapped {
nbdToolsFound := checkRbdNbdTools(b.exec)
nbdToolsFound = checkRbdNbdTools(b.exec)
if nbdToolsFound {
devicePath, mapped = waitForPath(b.Pool, b.Image, 1 /*maxRetries*/, true /*useNbdDriver*/)
}