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
3278de72
Commit
3278de72
authored
May 09, 2017
by
Klaus Ma
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
generated client-go.
parent
7bf698a2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
0 deletions
+23
-0
factory.go
staging/src/k8s.io/client-go/informers/factory.go
+23
-0
No files found.
staging/src/k8s.io/client-go/informers/factory.go
View file @
3278de72
...
@@ -73,6 +73,28 @@ func (f *sharedInformerFactory) Start(stopCh <-chan struct{}) {
...
@@ -73,6 +73,28 @@ func (f *sharedInformerFactory) Start(stopCh <-chan struct{}) {
}
}
}
}
// WaitForCacheSync waits for all started informers' cache were synced.
func
(
f
*
sharedInformerFactory
)
WaitForCacheSync
(
stopCh
<-
chan
struct
{})
map
[
reflect
.
Type
]
bool
{
informers
:=
func
()
map
[
reflect
.
Type
]
cache
.
SharedIndexInformer
{
f
.
lock
.
Lock
()
defer
f
.
lock
.
Unlock
()
informers
:=
map
[
reflect
.
Type
]
cache
.
SharedIndexInformer
{}
for
informerType
,
informer
:=
range
f
.
informers
{
if
f
.
startedInformers
[
informerType
]
{
informers
[
informerType
]
=
informer
}
}
return
informers
}()
res
:=
map
[
reflect
.
Type
]
bool
{}
for
informType
,
informer
:=
range
informers
{
res
[
informType
]
=
cache
.
WaitForCacheSync
(
stopCh
,
informer
.
HasSynced
)
}
return
res
}
// InternalInformerFor returns the SharedIndexInformer for obj using an internal
// InternalInformerFor returns the SharedIndexInformer for obj using an internal
// client.
// client.
func
(
f
*
sharedInformerFactory
)
InformerFor
(
obj
runtime
.
Object
,
newFunc
internalinterfaces
.
NewInformerFunc
)
cache
.
SharedIndexInformer
{
func
(
f
*
sharedInformerFactory
)
InformerFor
(
obj
runtime
.
Object
,
newFunc
internalinterfaces
.
NewInformerFunc
)
cache
.
SharedIndexInformer
{
...
@@ -95,6 +117,7 @@ func (f *sharedInformerFactory) InformerFor(obj runtime.Object, newFunc internal
...
@@ -95,6 +117,7 @@ func (f *sharedInformerFactory) InformerFor(obj runtime.Object, newFunc internal
type
SharedInformerFactory
interface
{
type
SharedInformerFactory
interface
{
internalinterfaces
.
SharedInformerFactory
internalinterfaces
.
SharedInformerFactory
ForResource
(
resource
schema
.
GroupVersionResource
)
(
GenericInformer
,
error
)
ForResource
(
resource
schema
.
GroupVersionResource
)
(
GenericInformer
,
error
)
WaitForCacheSync
(
stopCh
<-
chan
struct
{})
map
[
reflect
.
Type
]
bool
Apps
()
apps
.
Interface
Apps
()
apps
.
Interface
Autoscaling
()
autoscaling
.
Interface
Autoscaling
()
autoscaling
.
Interface
...
...
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