From aac65db6ed21389de090057241beb613f73145dd Mon Sep 17 00:00:00 2001 From: yulng Date: Mon, 2 Jan 2023 15:28:06 +0800 Subject: [PATCH] make fsnotify event more readable Signed-off-by: yulng --- pkg/datapath/linux/ipsec/ipsec_linux.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/datapath/linux/ipsec/ipsec_linux.go b/pkg/datapath/linux/ipsec/ipsec_linux.go index d7198c83259b..dbc990827302 100644 --- a/pkg/datapath/linux/ipsec/ipsec_linux.go +++ b/pkg/datapath/linux/ipsec/ipsec_linux.go @@ -668,7 +668,7 @@ func keyfileWatcher(ctx context.Context, watcher *fswatcher.Watcher, keyfilePath for { select { case event := <-watcher.Events: - if event.Op&(fsnotify.Create|fsnotify.Write) == 0 { + if !event.Op.Has(fsnotify.Create) || !event.Op.Has(fsnotify.Write) { continue }