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
29081745
Commit
29081745
authored
Oct 19, 2018
by
andrewsykim
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
pass in stopCh to cloud provider Initialize method for custom controllers
parent
8b36038b
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
19 additions
and
13 deletions
+19
-13
controllermanager.go
cmd/cloud-controller-manager/app/controllermanager.go
+1
-1
controllermanager.go
cmd/kube-controller-manager/app/controllermanager.go
+1
-1
aws.go
pkg/cloudprovider/providers/aws/aws.go
+1
-1
azure.go
pkg/cloudprovider/providers/azure/azure.go
+1
-1
cloudstack.go
pkg/cloudprovider/providers/cloudstack/cloudstack.go
+2
-1
fake.go
pkg/cloudprovider/providers/fake/fake.go
+2
-1
gce.go
pkg/cloudprovider/providers/gce/gce.go
+1
-1
openstack.go
pkg/cloudprovider/providers/openstack/openstack.go
+2
-1
ovirt.go
pkg/cloudprovider/providers/ovirt/ovirt.go
+2
-1
photon.go
pkg/cloudprovider/providers/photon/photon.go
+2
-1
vsphere.go
pkg/cloudprovider/providers/vsphere/vsphere.go
+1
-1
cloud.go
staging/src/k8s.io/cloud-provider/cloud.go
+3
-2
No files found.
cmd/cloud-controller-manager/app/controllermanager.go
View file @
29081745
...
...
@@ -202,7 +202,7 @@ func startControllers(c *cloudcontrollerconfig.CompletedConfig, stop <-chan stru
}
if
cloud
!=
nil
{
// Initialize the cloud provider with a reference to the clientBuilder
cloud
.
Initialize
(
c
.
ClientBuilder
)
cloud
.
Initialize
(
c
.
ClientBuilder
,
stop
)
}
// Start the CloudNodeController
nodeController
:=
cloudcontrollers
.
NewCloudNodeController
(
...
...
cmd/kube-controller-manager/app/controllermanager.go
View file @
29081745
...
...
@@ -468,7 +468,7 @@ func StartControllers(ctx ControllerContext, startSATokenController InitFunc, co
// Initialize the cloud provider with a reference to the clientBuilder only after token controller
// has started in case the cloud provider uses the client builder.
if
ctx
.
Cloud
!=
nil
{
ctx
.
Cloud
.
Initialize
(
ctx
.
ClientBuilder
)
ctx
.
Cloud
.
Initialize
(
ctx
.
ClientBuilder
,
ctx
.
Stop
)
}
for
controllerName
,
initFn
:=
range
controllers
{
...
...
pkg/cloudprovider/providers/aws/aws.go
View file @
29081745
...
...
@@ -1159,7 +1159,7 @@ func newAWSCloud(cfg CloudConfig, awsServices Services) (*Cloud, error) {
}
// Initialize passes a Kubernetes clientBuilder interface to the cloud provider
func
(
c
*
Cloud
)
Initialize
(
clientBuilder
cloudprovider
.
ControllerClientBuilder
)
{
func
(
c
*
Cloud
)
Initialize
(
clientBuilder
cloudprovider
.
ControllerClientBuilder
,
stop
<-
chan
struct
{}
)
{
c
.
clientBuilder
=
clientBuilder
c
.
kubeClient
=
clientBuilder
.
ClientOrDie
(
"aws-cloud-provider"
)
c
.
eventBroadcaster
=
record
.
NewBroadcaster
()
...
...
pkg/cloudprovider/providers/azure/azure.go
View file @
29081745
...
...
@@ -390,7 +390,7 @@ func parseConfig(configReader io.Reader) (*Config, error) {
}
// Initialize passes a Kubernetes clientBuilder interface to the cloud provider
func
(
az
*
Cloud
)
Initialize
(
clientBuilder
cloudprovider
.
ControllerClientBuilder
)
{
func
(
az
*
Cloud
)
Initialize
(
clientBuilder
cloudprovider
.
ControllerClientBuilder
,
stop
<-
chan
struct
{}
)
{
az
.
kubeClient
=
clientBuilder
.
ClientOrDie
(
"azure-cloud-provider"
)
az
.
eventBroadcaster
=
record
.
NewBroadcaster
()
az
.
eventBroadcaster
.
StartRecordingToSink
(
&
v1core
.
EventSinkImpl
{
Interface
:
az
.
kubeClient
.
CoreV1
()
.
Events
(
""
)})
...
...
pkg/cloudprovider/providers/cloudstack/cloudstack.go
View file @
29081745
...
...
@@ -121,7 +121,8 @@ func newCSCloud(cfg *CSConfig) (*CSCloud, error) {
}
// Initialize passes a Kubernetes clientBuilder interface to the cloud provider
func
(
cs
*
CSCloud
)
Initialize
(
clientBuilder
cloudprovider
.
ControllerClientBuilder
)
{}
func
(
cs
*
CSCloud
)
Initialize
(
clientBuilder
cloudprovider
.
ControllerClientBuilder
,
stop
<-
chan
struct
{})
{
}
// LoadBalancer returns an implementation of LoadBalancer for CloudStack.
func
(
cs
*
CSCloud
)
LoadBalancer
()
(
cloudprovider
.
LoadBalancer
,
bool
)
{
...
...
pkg/cloudprovider/providers/fake/fake.go
View file @
29081745
...
...
@@ -97,7 +97,8 @@ func (f *FakeCloud) ClearCalls() {
}
// Initialize passes a Kubernetes clientBuilder interface to the cloud provider
func
(
f
*
FakeCloud
)
Initialize
(
clientBuilder
cloudprovider
.
ControllerClientBuilder
)
{}
func
(
f
*
FakeCloud
)
Initialize
(
clientBuilder
cloudprovider
.
ControllerClientBuilder
,
stop
<-
chan
struct
{})
{
}
func
(
f
*
FakeCloud
)
ListClusters
(
ctx
context
.
Context
)
([]
string
,
error
)
{
return
f
.
ClusterList
,
f
.
Err
...
...
pkg/cloudprovider/providers/gce/gce.go
View file @
29081745
...
...
@@ -610,7 +610,7 @@ func tryConvertToProjectNames(configProject, configNetworkProject string, servic
// Initialize takes in a clientBuilder and spawns a goroutine for watching the clusterid configmap.
// This must be called before utilizing the funcs of gce.ClusterID
func
(
gce
*
GCECloud
)
Initialize
(
clientBuilder
cloudprovider
.
ControllerClientBuilder
)
{
func
(
gce
*
GCECloud
)
Initialize
(
clientBuilder
cloudprovider
.
ControllerClientBuilder
,
stop
<-
chan
struct
{}
)
{
gce
.
clientBuilder
=
clientBuilder
gce
.
client
=
clientBuilder
.
ClientOrDie
(
"cloud-provider"
)
...
...
pkg/cloudprovider/providers/openstack/openstack.go
View file @
29081745
...
...
@@ -367,7 +367,8 @@ func newOpenStack(cfg Config) (*OpenStack, error) {
}
// Initialize passes a Kubernetes clientBuilder interface to the cloud provider
func
(
os
*
OpenStack
)
Initialize
(
clientBuilder
cloudprovider
.
ControllerClientBuilder
)
{}
func
(
os
*
OpenStack
)
Initialize
(
clientBuilder
cloudprovider
.
ControllerClientBuilder
,
stop
<-
chan
struct
{})
{
}
// mapNodeNameToServerName maps a k8s NodeName to an OpenStack Server Name
// This is a simple string cast.
...
...
pkg/cloudprovider/providers/ovirt/ovirt.go
View file @
29081745
...
...
@@ -117,7 +117,8 @@ func newOVirtCloud(config io.Reader) (*OVirtCloud, error) {
}
// Initialize passes a Kubernetes clientBuilder interface to the cloud provider
func
(
v
*
OVirtCloud
)
Initialize
(
clientBuilder
cloudprovider
.
ControllerClientBuilder
)
{}
func
(
v
*
OVirtCloud
)
Initialize
(
clientBuilder
cloudprovider
.
ControllerClientBuilder
,
stop
<-
chan
struct
{})
{
}
func
(
v
*
OVirtCloud
)
Clusters
()
(
cloudprovider
.
Clusters
,
bool
)
{
return
nil
,
false
...
...
pkg/cloudprovider/providers/photon/photon.go
View file @
29081745
...
...
@@ -286,7 +286,8 @@ func newPCCloud(cfg PCConfig) (*PCCloud, error) {
}
// Initialize passes a Kubernetes clientBuilder interface to the cloud provider
func
(
pc
*
PCCloud
)
Initialize
(
clientBuilder
cloudprovider
.
ControllerClientBuilder
)
{}
func
(
pc
*
PCCloud
)
Initialize
(
clientBuilder
cloudprovider
.
ControllerClientBuilder
,
stop
<-
chan
struct
{})
{
}
// Instances returns an implementation of Instances for Photon Controller.
func
(
pc
*
PCCloud
)
Instances
()
(
cloudprovider
.
Instances
,
bool
)
{
...
...
pkg/cloudprovider/providers/vsphere/vsphere.go
View file @
29081745
...
...
@@ -241,7 +241,7 @@ func init() {
}
// Initialize passes a Kubernetes clientBuilder interface to the cloud provider
func
(
vs
*
VSphere
)
Initialize
(
clientBuilder
cloudprovider
.
ControllerClientBuilder
)
{
func
(
vs
*
VSphere
)
Initialize
(
clientBuilder
cloudprovider
.
ControllerClientBuilder
,
stop
<-
chan
struct
{}
)
{
}
// Initialize Node Informers
...
...
staging/src/k8s.io/cloud-provider/cloud.go
View file @
29081745
...
...
@@ -42,8 +42,9 @@ type ControllerClientBuilder interface {
// Interface is an abstract, pluggable interface for cloud providers.
type
Interface
interface
{
// Initialize provides the cloud with a kubernetes client builder and may spawn goroutines
// to perform housekeeping activities within the cloud provider.
Initialize
(
clientBuilder
ControllerClientBuilder
)
// to perform housekeeping or run custom controllers specific to the cloud provider.
// Any tasks started here should be cleaned up when the stop channel closes.
Initialize
(
clientBuilder
ControllerClientBuilder
,
stop
<-
chan
struct
{})
// LoadBalancer returns a balancer interface. Also returns true if the interface is supported, false otherwise.
LoadBalancer
()
(
LoadBalancer
,
bool
)
// Instances returns an instances interface. Also returns true if the interface is supported, false otherwise.
...
...
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