Skip to content

Commit 30ed3b4

Browse files
authored
Merge pull request kubernetes#73317 from hello2mao/remove-cloud-nil-check
Remove unnecessary nil check for cloud
2 parents e160531 + ac8f0c8 commit 30ed3b4

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

cmd/cloud-controller-manager/app/controllermanager.go

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -212,13 +212,11 @@ func Run(c *cloudcontrollerconfig.CompletedConfig, stopCh <-chan struct{}) error
212212

213213
// startControllers starts the cloud specific controller loops.
214214
func startControllers(c *cloudcontrollerconfig.CompletedConfig, stopCh <-chan struct{}, cloud cloudprovider.Interface, controllers map[string]initFunc) error {
215-
if cloud != nil {
216-
// Initialize the cloud provider with a reference to the clientBuilder
217-
cloud.Initialize(c.ClientBuilder, stopCh)
218-
// Set the informer on the user cloud object
219-
if informerUserCloud, ok := cloud.(cloudprovider.InformerUser); ok {
220-
informerUserCloud.SetInformers(c.SharedInformers)
221-
}
215+
// Initialize the cloud provider with a reference to the clientBuilder
216+
cloud.Initialize(c.ClientBuilder, stopCh)
217+
// Set the informer on the user cloud object
218+
if informerUserCloud, ok := cloud.(cloudprovider.InformerUser); ok {
219+
informerUserCloud.SetInformers(c.SharedInformers)
222220
}
223221

224222
for controllerName, initFn := range controllers {

0 commit comments

Comments
 (0)