Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
5966ed77
Unverified
Commit
5966ed77
authored
Sep 14, 2018
by
k8s-ci-robot
Committed by
GitHub
Sep 14, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #68693 from davidz627/fix/dynamicLeak
Fixed leaking dynamic provioning test PDs
parents
f193e4b1
bd308d93
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
3 deletions
+20
-3
base.go
test/e2e/storage/testsuites/base.go
+20
-3
No files found.
test/e2e/storage/testsuites/base.go
View file @
5966ed77
...
...
@@ -18,6 +18,7 @@ package testsuites
import
(
"fmt"
"time"
.
"github.com/onsi/ginkgo"
.
"github.com/onsi/gomega"
...
...
@@ -192,9 +193,25 @@ func (r *genericVolumeTestResource) cleanupResource(driver drivers.TestDriver, p
volType
:=
pattern
.
VolType
if
r
.
pvc
!=
nil
||
r
.
pv
!=
nil
{
By
(
"Deleting pv and pvc"
)
if
errs
:=
framework
.
PVPVCCleanup
(
f
.
ClientSet
,
f
.
Namespace
.
Name
,
r
.
pv
,
r
.
pvc
);
len
(
errs
)
!=
0
{
framework
.
Failf
(
"Failed to delete PVC or PV: %v"
,
utilerrors
.
NewAggregate
(
errs
))
switch
volType
{
case
testpatterns
.
PreprovisionedPV
:
By
(
"Deleting pv and pvc"
)
if
errs
:=
framework
.
PVPVCCleanup
(
f
.
ClientSet
,
f
.
Namespace
.
Name
,
r
.
pv
,
r
.
pvc
);
len
(
errs
)
!=
0
{
framework
.
Failf
(
"Failed to delete PVC or PV: %v"
,
utilerrors
.
NewAggregate
(
errs
))
}
case
testpatterns
.
DynamicPV
:
By
(
"Deleting pvc"
)
// We only delete the PVC so that PV (and disk) can be cleaned up by dynamic provisioner
if
r
.
pv
.
Spec
.
PersistentVolumeReclaimPolicy
!=
v1
.
PersistentVolumeReclaimDelete
{
framework
.
Failf
(
"Test framework does not currently support Dynamically Provisioned Persistent Volume %v specified with reclaim policy that isnt %v"
,
r
.
pv
.
Name
,
v1
.
PersistentVolumeReclaimDelete
)
}
err
:=
framework
.
DeletePersistentVolumeClaim
(
f
.
ClientSet
,
r
.
pvc
.
Name
,
f
.
Namespace
.
Name
)
framework
.
ExpectNoError
(
err
,
"Failed to delete PVC %v"
,
r
.
pvc
.
Name
)
err
=
framework
.
WaitForPersistentVolumeDeleted
(
f
.
ClientSet
,
r
.
pv
.
Name
,
5
*
time
.
Second
,
5
*
time
.
Minute
)
framework
.
ExpectNoError
(
err
,
"Persistent Volume %v not deleted by dynamic provisioner"
,
r
.
pv
.
Name
)
default
:
framework
.
Failf
(
"Found PVC (%v) or PV (%v) but not running Preprovisioned or Dynamic test pattern"
,
r
.
pvc
,
r
.
pv
)
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment