• hui luo's avatar
    Add hierarchy support for plugin directory · d04f5968
    hui luo authored
    it traverses and watch plugin directory and its sub directory recursively,
    plugin socket file only need be unique within one directory,
    
    - plugin socket directory
    -    |
    -    ---->sub directory 1
    -    |              |
    -    |              ----->  socket1,  socket2 ...
    -    ----->sub directory 2
    -                  |
    -                  ------> socket1, socket2 ...
    
    the design itself allow sub directory be anything,
    but in practical, each plugin type could just use one sub directory.
    
    four bonus changes added as below
    
    1. extract example handler out from test, it is easier to read the code
    with the seperation.
    
    2. there are two variables here: "Watcher" and "watcher".
    "Watcher" is the plugin watcher, and "watcher" is the fsnotify watcher.
    so rename the "watcher" to "fsWatcher" to make code easier to
    understand.
    
    3. change RegisterCallbackFn() return value order, it is
    conventional to return error last, after this change,
    the pkg/volume/csi is compliance with golint, so remove it
    from hack/.golint_failures
    
    4. refactor errors handling at invokeRegistrationCallbackAtHandler()
    to make error message more clear.
    d04f5968
Name
Last commit
Last update
..
cache Loading commit data...
format Loading commit data...
ioutils Loading commit data...
manager Loading commit data...
pluginwatcher Loading commit data...
queue Loading commit data...
sliceutils Loading commit data...
store Loading commit data...
BUILD Loading commit data...
doc.go Loading commit data...
util.go Loading commit data...
util_test.go Loading commit data...
util_unix.go Loading commit data...
util_unsupported.go Loading commit data...
util_windows.go Loading commit data...