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
20d704aa
Commit
20d704aa
authored
Feb 18, 2016
by
Wojciech Tyczynski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix cacher_test unit test
parent
bcabc096
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
4 deletions
+12
-4
cacher_test.go
pkg/storage/cacher_test.go
+12
-4
No files found.
pkg/storage/cacher_test.go
View file @
20d704aa
...
...
@@ -110,13 +110,21 @@ func TestList(t *testing.T) {
t
.
Errorf
(
"Unexpected error: %v"
,
err
)
}
// We first List directly from etcd by passing empty resourceVersion,
// to get the current etcd resourceVersion.
rvResult
:=
&
api
.
PodList
{}
if
err
:=
cacher
.
List
(
context
.
TODO
(),
"pods/ns"
,
""
,
storage
.
Everything
,
rvResult
);
err
!=
nil
{
t
.
Errorf
(
"Unexpected error: %v"
,
err
)
}
deletedPodRV
:=
rvResult
.
ListMeta
.
ResourceVersion
result
:=
&
api
.
PodList
{}
//
TODO: We need to pass ResourceVersion of barPod deletion operation.
//
However, there is no easy way to get it, so it is hardcoded to 8
.
if
err
:=
cacher
.
List
(
context
.
TODO
(),
"pods/ns"
,
"8"
,
storage
.
Everything
,
result
);
err
!=
nil
{
//
We pass the current etcd ResourceVersion received from the above List() operation,
//
since there is not easy way to get ResourceVersion of barPod deletion operation
.
if
err
:=
cacher
.
List
(
context
.
TODO
(),
"pods/ns"
,
deletedPodRV
,
storage
.
Everything
,
result
);
err
!=
nil
{
t
.
Errorf
(
"Unexpected error: %v"
,
err
)
}
if
result
.
ListMeta
.
ResourceVersion
!=
"8"
{
if
result
.
ListMeta
.
ResourceVersion
!=
deletedPodRV
{
t
.
Errorf
(
"Incorrect resource version: %v"
,
result
.
ListMeta
.
ResourceVersion
)
}
if
len
(
result
.
Items
)
!=
2
{
...
...
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