diff --git a/pkg/volume/csi/csi_plugin.go b/pkg/volume/csi/csi_plugin.go index 5f5f9f0b0ca..e64022d4079 100644 --- a/pkg/volume/csi/csi_plugin.go +++ b/pkg/volume/csi/csi_plugin.go @@ -743,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 { @@ -782,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)