Skip to content

Commit

Permalink
Merge pull request kubernetes#29254 from ping035627/ping035627-patch-…
Browse files Browse the repository at this point in the history
…0718

Automatic merge from submit-queue

Judge the cloud isn't nil before use it in server.go

The PR add a judgement for the cloud before use it, because cloudprovider.InitCloudProvider maybe return nil for the cloud.
  • Loading branch information
k8s-merge-robot authored Jul 27, 2016
2 parents 9045dfe + a7d3c73 commit 5064306
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions cmd/kubelet/app/server.go
Original file line number Diff line number Diff line change
@@ -348,8 +348,12 @@ func run(s *options.KubeletServer, kcfg *KubeletConfig) (err error) {
if err != nil {
return err
}
glog.V(2).Infof("Successfully initialized cloud provider: %q from the config file: %q\n", s.CloudProvider, s.CloudConfigFile)
kcfg.Cloud = cloud
if cloud == nil {
glog.V(2).Infof("No cloud provider specified: %q from the config file: %q\n", s.CloudProvider, s.CloudConfigFile)
} else {
glog.V(2).Infof("Successfully initialized cloud provider: %q from the config file: %q\n", s.CloudProvider, s.CloudConfigFile)
kcfg.Cloud = cloud
}
}
}

0 comments on commit 5064306

Please sign in to comment.