Merge pull request #59872 from vmware/remove-production-code-usage-in-e2e-tests

Automatic merge from submit-queue. 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>.

Fixing diskIsAttached function

**What this PR does / why we need it**:
This PR fixes the `diskIsAttached` function. 
When disk is detached from the Node, this function was returning true, which results into time out for some vsphere e2e test cases.

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

**Special notes for your reviewer**:
Executed E2E test to verify failures are resolved with this change.

**Release note**:

```release-note
NONE
```
pull/6/head
Kubernetes Submit Queue 2018-02-14 21:34:22 -08:00 committed by GitHub
commit 00070b5490
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 5 deletions

View File

@ -719,11 +719,10 @@ func diskIsAttached(volPath string, nodeName string) (bool, error) {
nodeName)
return false, err
}
if device != nil {
framework.Logf("diskIsAttached found the disk %q attached on node %q",
volPath,
nodeName)
if device == nil {
return false, nil
}
framework.Logf("diskIsAttached found the disk %q attached on node %q", volPath, nodeName)
return true, nil
}

View File

@ -73,7 +73,7 @@ var _ = utils.SIGDescribe("Volume FStype [Feature:vsphere]", func() {
Bootstrap(f)
client = f.ClientSet
namespace = f.Namespace.Name
Expect(GetReadySchedulableNodeInfos).NotTo(BeEmpty())
Expect(GetReadySchedulableNodeInfos()).NotTo(BeEmpty())
})
It("verify fstype - ext3 formatted volume", func() {