Wrap fsnotify errors in flexvolume and filesystem

Wrap fsnotify errors in flexvolume and filesystem so both flexvolume and kube-proxy can use the improved error logging.
This commit is contained in:
shawnhuang92 committed 2026-04-20 21:02:11 +08:00
1 parent eb8032bb83
commit 99d7587b28
2 files changed
+3 -2

No files matched your search

+2 -1
View File
@@ -18,6 +18,7 @@ package filesystem
import (
"context"
"fmt"
"github.com/fsnotify/fsnotify"
)
@@ -65,7 +66,7 @@ func (w *fsnotifyWatcher) Init(eventHandler FSEventHandler, errorHandler FSError
var err error
w.watcher, err = fsnotify.NewWatcher()
if err != nil {
return err
return fmt.Errorf("fsnotify watcher init: %w", err)
}
w.eventHandler = eventHandler
+1 -1
View File
@@ -257,7 +257,7 @@ func (prober *flexVolumeProber) initWatcher() error {
klog.Errorf("Received an error from watcher: %s", err)
})
if err != nil {
return fmt.Errorf("error initializing watcher: %s", err)
return fmt.Errorf("flex volume: %w", err)
}
if err := prober.addWatchRecursive(prober.pluginDir); err != nil {