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
9ed73a94
Commit
9ed73a94
authored
Jan 21, 2019
by
Jan Safranek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Pass the test if event is not delivered
parent
dc3edee5
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
1 deletion
+18
-1
volume_provisioning.go
test/e2e/storage/volume_provisioning.go
+18
-1
No files found.
test/e2e/storage/volume_provisioning.go
View file @
9ed73a94
...
@@ -844,7 +844,10 @@ var _ = utils.SIGDescribe("Dynamic Provisioning", func() {
...
@@ -844,7 +844,10 @@ var _ = utils.SIGDescribe("Dynamic Provisioning", func() {
}
}
}()
}()
// Watch events until the message about invalid key appears
// Watch events until the message about invalid key appears.
// Event delivery is not reliable and it's used only as a quick way how to check if volume with wrong KMS
// key was not provisioned. If the event is not delivered, we check that the volume is not Bound for whole
// ClaimProvisionTimeout in the very same loop.
err
=
wait
.
Poll
(
time
.
Second
,
framework
.
ClaimProvisionTimeout
,
func
()
(
bool
,
error
)
{
err
=
wait
.
Poll
(
time
.
Second
,
framework
.
ClaimProvisionTimeout
,
func
()
(
bool
,
error
)
{
events
,
err
:=
c
.
CoreV1
()
.
Events
(
claim
.
Namespace
)
.
List
(
metav1
.
ListOptions
{})
events
,
err
:=
c
.
CoreV1
()
.
Events
(
claim
.
Namespace
)
.
List
(
metav1
.
ListOptions
{})
Expect
(
err
)
.
NotTo
(
HaveOccurred
())
Expect
(
err
)
.
NotTo
(
HaveOccurred
())
...
@@ -853,8 +856,22 @@ var _ = utils.SIGDescribe("Dynamic Provisioning", func() {
...
@@ -853,8 +856,22 @@ var _ = utils.SIGDescribe("Dynamic Provisioning", func() {
return
true
,
nil
return
true
,
nil
}
}
}
}
pvc
,
err
:=
c
.
CoreV1
()
.
PersistentVolumeClaims
(
claim
.
Namespace
)
.
Get
(
claim
.
Name
,
metav1
.
GetOptions
{})
if
err
!=
nil
{
return
true
,
err
}
if
pvc
.
Status
.
Phase
!=
v1
.
ClaimPending
{
// The PVC was bound to something, i.e. PV was created for wrong KMS key. That's bad!
return
true
,
fmt
.
Errorf
(
"PVC got unexpectedly %s (to PV %q)"
,
pvc
.
Status
.
Phase
,
pvc
.
Spec
.
VolumeName
)
}
return
false
,
nil
return
false
,
nil
})
})
if
err
==
wait
.
ErrWaitTimeout
{
framework
.
Logf
(
"The test missed event about failed provisioning, but checked that no volume was provisioned for %v"
,
framework
.
ClaimProvisionTimeout
)
err
=
nil
}
Expect
(
err
)
.
NotTo
(
HaveOccurred
())
Expect
(
err
)
.
NotTo
(
HaveOccurred
())
})
})
})
})
...
...
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