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
189bb742
Commit
189bb742
authored
Oct 06, 2016
by
Kubernetes Submit Queue
Committed by
GitHub
Oct 06, 2016
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #34234 from wojtek-t/minor_etcd3_change
Automatic merge from submit-queue Minor clearnup in etcd3 code Ref #20504
parents
0f40c1a6
d70a9615
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
5 deletions
+5
-5
store.go
pkg/storage/etcd3/store.go
+4
-4
watcher_test.go
pkg/storage/etcd3/watcher_test.go
+1
-1
No files found.
pkg/storage/etcd3/store.go
View file @
189bb742
...
@@ -314,21 +314,21 @@ func (s *store) List(ctx context.Context, key, resourceVersion string, pred stor
...
@@ -314,21 +314,21 @@ func (s *store) List(ctx context.Context, key, resourceVersion string, pred stor
// Watch implements storage.Interface.Watch.
// Watch implements storage.Interface.Watch.
func
(
s
*
store
)
Watch
(
ctx
context
.
Context
,
key
string
,
resourceVersion
string
,
pred
storage
.
SelectionPredicate
)
(
watch
.
Interface
,
error
)
{
func
(
s
*
store
)
Watch
(
ctx
context
.
Context
,
key
string
,
resourceVersion
string
,
pred
storage
.
SelectionPredicate
)
(
watch
.
Interface
,
error
)
{
return
s
.
watch
(
ctx
,
key
,
resourceVersion
,
storage
.
SimpleFilter
(
pred
)
,
false
)
return
s
.
watch
(
ctx
,
key
,
resourceVersion
,
pred
,
false
)
}
}
// WatchList implements storage.Interface.WatchList.
// WatchList implements storage.Interface.WatchList.
func
(
s
*
store
)
WatchList
(
ctx
context
.
Context
,
key
string
,
resourceVersion
string
,
pred
storage
.
SelectionPredicate
)
(
watch
.
Interface
,
error
)
{
func
(
s
*
store
)
WatchList
(
ctx
context
.
Context
,
key
string
,
resourceVersion
string
,
pred
storage
.
SelectionPredicate
)
(
watch
.
Interface
,
error
)
{
return
s
.
watch
(
ctx
,
key
,
resourceVersion
,
storage
.
SimpleFilter
(
pred
)
,
true
)
return
s
.
watch
(
ctx
,
key
,
resourceVersion
,
pred
,
true
)
}
}
func
(
s
*
store
)
watch
(
ctx
context
.
Context
,
key
string
,
rv
string
,
filter
storage
.
FilterFunc
,
recursive
bool
)
(
watch
.
Interface
,
error
)
{
func
(
s
*
store
)
watch
(
ctx
context
.
Context
,
key
string
,
rv
string
,
pred
storage
.
SelectionPredicate
,
recursive
bool
)
(
watch
.
Interface
,
error
)
{
rev
,
err
:=
storage
.
ParseWatchResourceVersion
(
rv
)
rev
,
err
:=
storage
.
ParseWatchResourceVersion
(
rv
)
if
err
!=
nil
{
if
err
!=
nil
{
return
nil
,
err
return
nil
,
err
}
}
key
=
keyWithPrefix
(
s
.
pathPrefix
,
key
)
key
=
keyWithPrefix
(
s
.
pathPrefix
,
key
)
return
s
.
watcher
.
Watch
(
ctx
,
key
,
int64
(
rev
),
recursive
,
filter
)
return
s
.
watcher
.
Watch
(
ctx
,
key
,
int64
(
rev
),
recursive
,
storage
.
SimpleFilter
(
pred
)
)
}
}
func
(
s
*
store
)
getState
(
getResp
*
clientv3
.
GetResponse
,
key
string
,
v
reflect
.
Value
,
ignoreNotFound
bool
)
(
*
objState
,
error
)
{
func
(
s
*
store
)
getState
(
getResp
*
clientv3
.
GetResponse
,
key
string
,
v
reflect
.
Value
,
ignoreNotFound
bool
)
(
*
objState
,
error
)
{
...
...
pkg/storage/etcd3/watcher_test.go
View file @
189bb742
...
@@ -92,7 +92,7 @@ func testWatch(t *testing.T, recursive bool) {
...
@@ -92,7 +92,7 @@ func testWatch(t *testing.T, recursive bool) {
},
},
}}
}}
for
i
,
tt
:=
range
tests
{
for
i
,
tt
:=
range
tests
{
w
,
err
:=
store
.
watch
(
ctx
,
tt
.
key
,
"0"
,
storage
.
SimpleFilter
(
tt
.
pred
)
,
recursive
)
w
,
err
:=
store
.
watch
(
ctx
,
tt
.
key
,
"0"
,
tt
.
pred
,
recursive
)
if
err
!=
nil
{
if
err
!=
nil
{
t
.
Fatalf
(
"Watch failed: %v"
,
err
)
t
.
Fatalf
(
"Watch failed: %v"
,
err
)
}
}
...
...
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