Merge pull request #44180 from copejon/fix-improper-pd-cleanup

Automatic merge from submit-queue (batch tested with PRs 43373, 41780, 44141, 43914, 44180)

move PD delete to AfterEach

**What this PR does / why we need it**:
Fixes a bug in PersistentVolume E2E that causes GCEPDs to be left un-deleted after a test ends.

```release-note
None
```
pull/6/head
Kubernetes Submit Queue 2017-04-07 09:57:42 -07:00 committed by GitHub
commit 5e442a3f61
1 changed files with 3 additions and 6 deletions

View File

@ -107,12 +107,9 @@ var _ = framework.KubeDescribe("PersistentVolumes:GCEPD [Volume]", func() {
framework.DeletePodWithWait(f, c, clientPod) framework.DeletePodWithWait(f, c, clientPod)
framework.PVPVCCleanup(c, ns, pv, pvc) framework.PVPVCCleanup(c, ns, pv, pvc)
clientPod, pv, pvc, node = nil, nil, nil, "" clientPod, pv, pvc, node = nil, nil, nil, ""
} if diskName != "" {
}) framework.DeletePDWithRetry(diskName)
}
AddCleanupAction(func() {
if len(diskName) > 0 {
framework.DeletePDWithRetry(diskName)
} }
}) })