From 384aaad468586505bf93927283609585babfd35e Mon Sep 17 00:00:00 2001 From: Ted Yu Date: Sat, 21 Sep 2019 07:02:51 -0700 Subject: [PATCH] Check error return from WaitForCacheSync --- pkg/volume/csi/csi_plugin.go | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/pkg/volume/csi/csi_plugin.go b/pkg/volume/csi/csi_plugin.go index f90878302ba..e64022d4079 100644 --- a/pkg/volume/csi/csi_plugin.go +++ b/pkg/volume/csi/csi_plugin.go @@ -60,8 +60,6 @@ const ( CsiResyncPeriod = time.Minute ) -var deprecatedSocketDirVersions = []string{"0.1.0", "0.2.0", "0.3.0", "0.4.0"} - type csiPlugin struct { host volume.VolumeHost blockEnabled bool @@ -745,7 +743,9 @@ func (p *csiPlugin) skipAttach(driver string) (bool, error) { kletHost, ok := p.host.(volume.KubeletVolumeHost) if ok { - kletHost.WaitForCacheSync() + if err := kletHost.WaitForCacheSync(); err != nil { + return false, err + } } if p.csiDriverLister == nil { @@ -784,7 +784,9 @@ func (p *csiPlugin) supportsVolumeLifecycleMode(driver string, volumeMode storag if p.csiDriverLister != nil { kletHost, ok := p.host.(volume.KubeletVolumeHost) if ok { - kletHost.WaitForCacheSync() + if err := kletHost.WaitForCacheSync(); err != nil { + return err + } } c, err := p.csiDriverLister.Get(driver)