cri: check fsnotify watcher when receiving cni conf dir events

carry: 612f5f9f44

Signed-off-by: Wei Fu <fuweid89@gmail.com>
This commit is contained in:
f00231050 2020-12-10 10:05:07 +08:00 committed by Wei Fu
parent 134f7a7370
commit 591caece0c

View File

@ -73,7 +73,11 @@ func newCNINetConfSyncer(confDir string, netPlugin cni.CNI, loadOpts []cni.CNIOp
func (syncer *cniNetConfSyncer) syncLoop() error {
for {
select {
case event := <-syncer.watcher.Events:
case event, ok := <-syncer.watcher.Events:
if !ok {
logrus.Debugf("cni watcher channel is closed")
return nil
}
// Only reload config when receiving write/rename/remove
// events
//