added missing error check

This commit is contained in:
technicianted 2018-03-08 21:39:22 -08:00 committed by technicianted
parent 0aad894b9d
commit 659d9df117

View File

@ -176,9 +176,11 @@ func (prober *flexVolumeProber) updateProbeNeeded() {
// on its parent directory.
func (prober *flexVolumeProber) addWatchRecursive(filename string) error {
addWatch := func(path string, info os.FileInfo, err error) error {
if info.IsDir() {
if err := prober.watcher.AddWatch(path); err != nil {
glog.Errorf("Error recursively adding watch: %v", err)
if err == nil {
if info.IsDir() {
if err := prober.watcher.AddWatch(path); err != nil {
glog.Errorf("Error recursively adding watch: %v", err)
}
}
}
return nil