mirror of https://github.com/k3s-io/k3s
Merge pull request #29254 from ping035627/ping035627-patch-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.pull/6/head
commit
5064306808
|
@ -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
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue