Skip to content

Commit 591caec

Browse files
f00231050fuweid
authored andcommitted
cri: check fsnotify watcher when receiving cni conf dir events
carry: 612f5f9 Signed-off-by: Wei Fu <[email protected]>
1 parent 134f7a7 commit 591caec

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

pkg/cri/server/cni_conf_syncer.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,11 @@ func newCNINetConfSyncer(confDir string, netPlugin cni.CNI, loadOpts []cni.CNIOp
7373
func (syncer *cniNetConfSyncer) syncLoop() error {
7474
for {
7575
select {
76-
case event := <-syncer.watcher.Events:
76+
case event, ok := <-syncer.watcher.Events:
77+
if !ok {
78+
logrus.Debugf("cni watcher channel is closed")
79+
return nil
80+
}
7781
// Only reload config when receiving write/rename/remove
7882
// events
7983
//

0 commit comments

Comments
 (0)