mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-17 15:13:08 +00:00
fsnotify: use event.Has instead of "event.Op&h == h"
This commit is contained in:
@@ -257,10 +257,7 @@ func (o *Options) initWatcher() error {
|
||||
}
|
||||
|
||||
func (o *Options) eventHandler(ent fsnotify.Event) {
|
||||
eventOpIs := func(Op fsnotify.Op) bool {
|
||||
return ent.Op&Op == Op
|
||||
}
|
||||
if eventOpIs(fsnotify.Write) || eventOpIs(fsnotify.Rename) {
|
||||
if ent.Has(fsnotify.Write) || ent.Has(fsnotify.Rename) {
|
||||
// error out when ConfigFile is updated
|
||||
o.errCh <- fmt.Errorf("content of the proxy server's configuration file was updated")
|
||||
return
|
||||
|
Reference in New Issue
Block a user