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
1ab88c94
Unverified
Commit
1ab88c94
authored
Aug 25, 2017
by
Mikhail Mazurskiy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Call the right cleanup function
parent
1f580ae8
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
2 deletions
+4
-2
reflector.go
staging/src/k8s.io/client-go/tools/cache/reflector.go
+4
-2
No files found.
staging/src/k8s.io/client-go/tools/cache/reflector.go
View file @
1ab88c94
...
...
@@ -239,8 +239,6 @@ func (r *Reflector) resyncChan() (<-chan time.Time, func() bool) {
func
(
r
*
Reflector
)
ListAndWatch
(
stopCh
<-
chan
struct
{})
error
{
glog
.
V
(
3
)
.
Infof
(
"Listing and watching %v from %s"
,
r
.
expectedType
,
r
.
name
)
var
resourceVersion
string
resyncCh
,
cleanup
:=
r
.
resyncChan
()
defer
cleanup
()
// Explicitly set "0" as resource version - it's fine for the List()
// to be served from cache and potentially be delayed relative to
...
...
@@ -272,6 +270,10 @@ func (r *Reflector) ListAndWatch(stopCh <-chan struct{}) error {
cancelCh
:=
make
(
chan
struct
{})
defer
close
(
cancelCh
)
go
func
()
{
resyncCh
,
cleanup
:=
r
.
resyncChan
()
defer
func
()
{
cleanup
()
// Call the last one written into cleanup
}()
for
{
select
{
case
<-
resyncCh
:
...
...
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