mirror of https://github.com/k3s-io/k3s
Merge pull request #73317 from hello2mao/remove-cloud-nil-check
Remove unnecessary nil check for cloudpull/564/head
commit
30ed3b41b7
|
@ -212,13 +212,11 @@ func Run(c *cloudcontrollerconfig.CompletedConfig, stopCh <-chan struct{}) error
|
|||
|
||||
// startControllers starts the cloud specific controller loops.
|
||||
func startControllers(c *cloudcontrollerconfig.CompletedConfig, stopCh <-chan struct{}, cloud cloudprovider.Interface, controllers map[string]initFunc) error {
|
||||
if cloud != nil {
|
||||
// Initialize the cloud provider with a reference to the clientBuilder
|
||||
cloud.Initialize(c.ClientBuilder, stopCh)
|
||||
// Set the informer on the user cloud object
|
||||
if informerUserCloud, ok := cloud.(cloudprovider.InformerUser); ok {
|
||||
informerUserCloud.SetInformers(c.SharedInformers)
|
||||
}
|
||||
// Initialize the cloud provider with a reference to the clientBuilder
|
||||
cloud.Initialize(c.ClientBuilder, stopCh)
|
||||
// Set the informer on the user cloud object
|
||||
if informerUserCloud, ok := cloud.(cloudprovider.InformerUser); ok {
|
||||
informerUserCloud.SetInformers(c.SharedInformers)
|
||||
}
|
||||
|
||||
for controllerName, initFn := range controllers {
|
||||
|
|
Loading…
Reference in New Issue