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
fad23990
Unverified
Commit
fad23990
authored
Nov 26, 2018
by
k8s-ci-robot
Committed by
GitHub
Nov 26, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #71429 from gnufied/fix-detach-while-mount-flake
Fix flake with e2e test that checks detach while mount in progress
parents
ce68cfa4
df88257a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
0 deletions
+23
-0
detach_mounted.go
test/e2e/storage/detach_mounted.go
+23
-0
No files found.
test/e2e/storage/detach_mounted.go
View file @
fad23990
...
...
@@ -84,10 +84,17 @@ var _ = utils.SIGDescribe("Detaching volumes", func() {
uniqueVolumeName
:=
getUniqueVolumeName
(
pod
,
driverInstallAs
)
By
(
"waiting for volumes to be attached to node"
)
err
=
waitForVolumesAttached
(
cs
,
node
.
Name
,
uniqueVolumeName
)
Expect
(
err
)
.
NotTo
(
HaveOccurred
(),
"while waiting for volume to attach to %s node"
,
node
.
Name
)
By
(
"waiting for volume-in-use on the node after pod creation"
)
err
=
waitForVolumesInUse
(
cs
,
node
.
Name
,
uniqueVolumeName
)
Expect
(
err
)
.
NotTo
(
HaveOccurred
(),
"while waiting for volume in use"
)
By
(
"waiting for kubelet to start mounting the volume"
)
time
.
Sleep
(
20
*
time
.
Second
)
By
(
"Deleting the flexvolume pod"
)
err
=
framework
.
DeletePodWithWait
(
f
,
cs
,
pod
)
Expect
(
err
)
.
NotTo
(
HaveOccurred
(),
"in deleting the pod"
)
...
...
@@ -134,6 +141,22 @@ func waitForVolumesNotInUse(client clientset.Interface, nodeName, volumeName str
})
}
func
waitForVolumesAttached
(
client
clientset
.
Interface
,
nodeName
,
volumeName
string
)
error
{
return
wait
.
PollImmediate
(
2
*
time
.
Second
,
2
*
time
.
Minute
,
func
()
(
bool
,
error
)
{
node
,
err
:=
client
.
CoreV1
()
.
Nodes
()
.
Get
(
nodeName
,
metav1
.
GetOptions
{})
if
err
!=
nil
{
return
false
,
fmt
.
Errorf
(
"error fetching node %s with %v"
,
nodeName
,
err
)
}
volumeAttached
:=
node
.
Status
.
VolumesAttached
for
_
,
volume
:=
range
volumeAttached
{
if
string
(
volume
.
Name
)
==
volumeName
{
return
true
,
nil
}
}
return
false
,
nil
})
}
func
waitForVolumesInUse
(
client
clientset
.
Interface
,
nodeName
,
volumeName
string
)
error
{
return
wait
.
PollImmediate
(
10
*
time
.
Second
,
60
*
time
.
Second
,
func
()
(
bool
,
error
)
{
node
,
err
:=
client
.
CoreV1
()
.
Nodes
()
.
Get
(
nodeName
,
metav1
.
GetOptions
{})
...
...
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