Change fsnotify event status condition.

Signed-off-by: yanggang <gang.yang@daocloud.io>
This commit is contained in:
yanggang 2022-11-20 09:43:54 +08:00
parent 2cea525eee
commit 579c7f43de
No known key found for this signature in database
GPG Key ID: 7F6E0CAD1556A240
2 changed files with 2 additions and 2 deletions

View File

@ -83,7 +83,7 @@ func (syncer *cniNetConfSyncer) syncLoop() error {
// //
// TODO(fuweid): Might only reload target cni config // TODO(fuweid): Might only reload target cni config
// files to prevent no-ops. // files to prevent no-ops.
if event.Op&(fsnotify.Chmod|fsnotify.Create) > 0 { if event.Has(fsnotify.Chmod) || event.Has(fsnotify.Create) {
logrus.Debugf("ignore event from cni conf dir: %s", event) logrus.Debugf("ignore event from cni conf dir: %s", event)
continue continue
} }

View File

@ -83,7 +83,7 @@ func (syncer *cniNetConfSyncer) syncLoop() error {
// //
// TODO(fuweid): Might only reload target cni config // TODO(fuweid): Might only reload target cni config
// files to prevent no-ops. // files to prevent no-ops.
if event.Op&(fsnotify.Chmod|fsnotify.Create) > 0 { if event.Has(fsnotify.Chmod) || event.Has(fsnotify.Create) {
logrus.Debugf("ignore event from cni conf dir: %s", event) logrus.Debugf("ignore event from cni conf dir: %s", event)
continue continue
} }