From ac8f0c81e5721f742a970b2d5f859f7883ce012a Mon Sep 17 00:00:00 2001 From: maohongbin01 Date: Fri, 25 Jan 2019 23:26:40 +0800 Subject: [PATCH] remove unnecessary nil check for cloud --- .../app/controllermanager.go | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/cmd/cloud-controller-manager/app/controllermanager.go b/cmd/cloud-controller-manager/app/controllermanager.go index ee3c80a7c2..8bd26c8240 100644 --- a/cmd/cloud-controller-manager/app/controllermanager.go +++ b/cmd/cloud-controller-manager/app/controllermanager.go @@ -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 {