mirror of
https://github.com/kubernetes/kubernetes.git
synced 2026-10-28 15:05:03 +08:00
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:
1 parent
eb8032bb83
commit
99d7587b28
2 files changed
+3
-2
No files matched your search
@@ -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
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in new issue
Block a user