Merge pull request #5116 from fuweid/carry-4825

cri: check fsnotify watcher when receiving cni conf dir events
This commit is contained in:
Phil Estes 2021-03-03 17:26:57 -05:00 committed by GitHub
commit 2f71f4f63c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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
//