mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-02 16:29:21 +00:00
reduce nesting
This commit is contained in:
parent
659d9df117
commit
0fb8072b19
@ -176,13 +176,11 @@ func (prober *flexVolumeProber) updateProbeNeeded() {
|
|||||||
// on its parent directory.
|
// on its parent directory.
|
||||||
func (prober *flexVolumeProber) addWatchRecursive(filename string) error {
|
func (prober *flexVolumeProber) addWatchRecursive(filename string) error {
|
||||||
addWatch := func(path string, info os.FileInfo, err error) error {
|
addWatch := func(path string, info os.FileInfo, err error) error {
|
||||||
if err == nil {
|
if err == nil && info.IsDir() {
|
||||||
if info.IsDir() {
|
|
||||||
if err := prober.watcher.AddWatch(path); err != nil {
|
if err := prober.watcher.AddWatch(path); err != nil {
|
||||||
glog.Errorf("Error recursively adding watch: %v", err)
|
glog.Errorf("Error recursively adding watch: %v", err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
return prober.fs.Walk(filename, addWatch)
|
return prober.fs.Walk(filename, addWatch)
|
||||||
|
Loading…
Reference in New Issue
Block a user