Skip to content

Commit 612f5f9

Browse files
author
f00231050
committed
[cri] add a second parameter to check if fsnotify watcher closed,
when receiving cni conf dir events
1 parent 7b0149a commit 612f5f9

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("channel is closed")
79+
return nil
80+
}
7781
// Only reload config when receiving write/rename/remove
7882
// events
7983
//

0 commit comments

Comments
 (0)