mirror of https://github.com/k3s-io/k3s
remove unnecessary nil check for cloud
parent
d654b49c0e
commit
ac8f0c81e5
|
@ -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