diff --git a/pkg/datapath/linux/ipsec/ipsec_linux.go b/pkg/datapath/linux/ipsec/ipsec_linux.go index ccab4915bf62..3907b7a1c5d9 100644 --- a/pkg/datapath/linux/ipsec/ipsec_linux.go +++ b/pkg/datapath/linux/ipsec/ipsec_linux.go @@ -917,7 +917,7 @@ func keyfileWatcher(ctx context.Context, watcher *fswatcher.Watcher, keyfilePath for { select { case event := <-watcher.Events: - if !event.Op.Has(fsnotify.Create) || !event.Op.Has(fsnotify.Write) { + if event.Op&(fsnotify.Create|fsnotify.Write) == 0 { continue }