Merge pull request #75308 from msau42/csi-beta-e2e

ignore kubeclient nil in csi plugin init
pull/564/head
Kubernetes Prow Robot 2019-03-13 05:49:46 -07:00 committed by GitHub
commit 517922f31a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 6 deletions

View File

@ -215,14 +215,15 @@ func (p *csiPlugin) Init(host volume.VolumeHost) error {
if utilfeature.DefaultFeatureGate.Enabled(features.CSIDriverRegistry) {
csiClient := host.GetKubeClient()
if csiClient == nil {
return errors.New("unable to get Kubernetes client")
}
klog.Warning(log("kubeclient not set, assuming standalone kubelet"))
} else {
// Start informer for CSIDrivers.
factory := csiapiinformer.NewSharedInformerFactory(csiClient, csiResyncPeriod)
p.csiDriverInformer = factory.Storage().V1beta1().CSIDrivers()
p.csiDriverLister = p.csiDriverInformer.Lister()
go factory.Start(wait.NeverStop)
}
}
var migratedPlugins = map[string](func() bool){
csitranslationplugins.GCEPDInTreePluginName: func() bool {