pass in stopCh for GCE cluster ID controller

This commit is contained in:
andrewsykim 2018-10-19 17:01:13 -04:00
parent 2908174517
commit 3521ebd1e7
2 changed files with 3 additions and 3 deletions

View File

@ -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.

View File

@ -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