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
cbb422c2
Unverified
Commit
cbb422c2
authored
Oct 19, 2018
by
k8s-ci-robot
Committed by
GitHub
Oct 19, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #70038 from andrewsykim/cloud-initialize-stopch
pass in stopCh to cloud provider Initialize method for custom controllers
parents
6382f1b5
3521ebd1
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
22 additions
and
16 deletions
+22
-16
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
+2
-2
gce_clusterid.go
pkg/cloudprovider/providers/gce/gce_clusterid.go
+2
-2
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 @
cbb422c2
...
...
@@ -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 @
cbb422c2
...
...
@@ -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 @
cbb422c2
...
...
@@ -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 @
cbb422c2
...
...
@@ -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 @
cbb422c2
...
...
@@ -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 @
cbb422c2
...
...
@@ -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 @
cbb422c2
...
...
@@ -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"
)
...
...
@@ -620,7 +620,7 @@ func (gce *GCECloud) Initialize(clientBuilder cloudprovider.ControllerClientBuil
gce
.
eventRecorder
=
gce
.
eventBroadcaster
.
NewRecorder
(
scheme
.
Scheme
,
v1
.
EventSource
{
Component
:
"gce-cloudprovider"
})
}
go
gce
.
watchClusterID
()
go
gce
.
watchClusterID
(
stop
)
}
// LoadBalancer returns an implementation of LoadBalancer for Google Compute Engine.
...
...
pkg/cloudprovider/providers/gce/gce_clusterid.go
View file @
cbb422c2
...
...
@@ -59,7 +59,7 @@ type ClusterID struct {
}
// Continually watches for changes to the cluster id config map
func
(
gce
*
GCECloud
)
watchClusterID
()
{
func
(
gce
*
GCECloud
)
watchClusterID
(
stop
<-
chan
struct
{}
)
{
gce
.
ClusterID
=
ClusterID
{
cfgMapKey
:
fmt
.
Sprintf
(
"%v/%v"
,
UIDNamespace
,
UIDConfigMapName
),
client
:
gce
.
client
,
...
...
@@ -105,7 +105,7 @@ func (gce *GCECloud) watchClusterID() {
var
controller
cache
.
Controller
gce
.
ClusterID
.
store
,
controller
=
cache
.
NewInformer
(
newSingleObjectListerWatcher
(
listerWatcher
,
UIDConfigMapName
),
&
v1
.
ConfigMap
{},
updateFuncFrequency
,
mapEventHandler
)
controller
.
Run
(
nil
)
controller
.
Run
(
stop
)
}
// GetID returns the id which is unique to this cluster
...
...
pkg/cloudprovider/providers/openstack/openstack.go
View file @
cbb422c2
...
...
@@ -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 @
cbb422c2
...
...
@@ -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 @
cbb422c2
...
...
@@ -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 @
cbb422c2
...
...
@@ -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 @
cbb422c2
...
...
@@ -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