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
50de5404
Commit
50de5404
authored
Aug 20, 2015
by
Saad Ali
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #12772 from smarterclayton/allow_nil_reflector
Allow a nil expectedType in cache.Reflector
parents
1aeeeaec
f1e4f652
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
5 deletions
+5
-5
reflector.go
pkg/client/unversioned/cache/reflector.go
+5
-5
No files found.
pkg/client/unversioned/cache/reflector.go
View file @
50de5404
...
...
@@ -79,10 +79,10 @@ func NewNamespaceKeyedIndexerAndReflector(lw ListerWatcher, expectedType interfa
// NewReflector creates a new Reflector object which will keep the given store up to
// date with the server's contents for the given resource. Reflector promises to
// only put things in the store that have the type of expectedType
.
//
If resyncPeriod is non-zero, then lists will be executed after every resyncPeriod,
//
so that you can use reflectors to periodically process everything as well
as
// incrementally processing the things that change.
// only put things in the store that have the type of expectedType
, unless expectedType
//
is nil. If resyncPeriod is non-zero, then lists will be executed after every
//
resyncPeriod, so that you can use reflectors to periodically process everything
as
//
well as
incrementally processing the things that change.
func
NewReflector
(
lw
ListerWatcher
,
expectedType
interface
{},
store
Store
,
resyncPeriod
time
.
Duration
)
*
Reflector
{
return
NewNamedReflector
(
getDefaultReflectorName
(
internalPackages
...
),
lw
,
expectedType
,
store
,
resyncPeriod
)
}
...
...
@@ -265,7 +265,7 @@ loop:
if
event
.
Type
==
watch
.
Error
{
return
apierrs
.
FromObject
(
event
.
Object
)
}
if
e
,
a
:=
r
.
expectedType
,
reflect
.
TypeOf
(
event
.
Object
);
e
!=
a
{
if
e
,
a
:=
r
.
expectedType
,
reflect
.
TypeOf
(
event
.
Object
);
e
!=
nil
&&
e
!=
a
{
util
.
HandleError
(
fmt
.
Errorf
(
"%s: expected type %v, but watch event object had type %v"
,
r
.
name
,
e
,
a
))
continue
}
...
...
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