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
8dbe762e
Commit
8dbe762e
authored
Aug 12, 2016
by
Marcin Wielgus
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
SetClientFactory in FederatedInformer
parent
9fe15e73
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
0 deletions
+14
-0
federated_informer.go
...tion/pkg/federation-controller/util/federated_informer.go
+14
-0
No files found.
federation/pkg/federation-controller/util/federated_informer.go
View file @
8dbe762e
...
@@ -96,6 +96,13 @@ type FederatedInformer interface {
...
@@ -96,6 +96,13 @@ type FederatedInformer interface {
Stop
()
Stop
()
}
}
// FederatedInformer with extra method for setting fake clients.
type
FederatedInformerForTestOnly
interface
{
FederatedInformer
SetClientFactory
(
func
(
*
federation_api
.
Cluster
)
(
federation_release_1_4
.
Interface
,
error
))
}
// A function that should be used to create an informer on the target object. Store should use
// A function that should be used to create an informer on the target object. Store should use
// framework.DeletionHandlingMetaNamespaceKeyFunc as a keying function.
// framework.DeletionHandlingMetaNamespaceKeyFunc as a keying function.
type
TargetInformerFactory
func
(
*
federation_api
.
Cluster
,
federation_release_1_4
.
Interface
)
(
cache
.
Store
,
framework
.
ControllerInterface
)
type
TargetInformerFactory
func
(
*
federation_api
.
Cluster
,
federation_release_1_4
.
Interface
)
(
cache
.
Store
,
framework
.
ControllerInterface
)
...
@@ -261,6 +268,13 @@ func (f *federatedInformerImpl) Start() {
...
@@ -261,6 +268,13 @@ func (f *federatedInformerImpl) Start() {
go
f
.
clusterInformer
.
controller
.
Run
(
f
.
clusterInformer
.
stopChan
)
go
f
.
clusterInformer
.
controller
.
Run
(
f
.
clusterInformer
.
stopChan
)
}
}
func
(
f
*
federatedInformerImpl
)
SetClientFactory
(
clientFactory
func
(
*
federation_api
.
Cluster
)
(
federation_release_1_4
.
Interface
,
error
))
{
f
.
Lock
()
defer
f
.
Unlock
()
f
.
clientFactory
=
clientFactory
}
// GetClientsetForCluster returns a clientset for the cluster, if present.
// GetClientsetForCluster returns a clientset for the cluster, if present.
func
(
f
*
federatedInformerImpl
)
GetClientsetForCluster
(
clusterName
string
)
(
federation_release_1_4
.
Interface
,
error
)
{
func
(
f
*
federatedInformerImpl
)
GetClientsetForCluster
(
clusterName
string
)
(
federation_release_1_4
.
Interface
,
error
)
{
f
.
Lock
()
f
.
Lock
()
...
...
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