Skip to content

Commit

Permalink
fix incorrect use of fsnotify in configtls
Browse files Browse the repository at this point in the history
  • Loading branch information
haoqixu committed Sep 13, 2023
1 parent 92f5fe6 commit c35cad9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions config/configtls/clientcasfilereloader.go
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ func (r *clientCAsFileReloader) handleWatcherEvents() {
// NOTE: k8s configmaps uses symlinks, we need this workaround.
// original configmap file is removed.
// SEE: https://martensson.io/go-fsnotify-and-kubernetes-configmaps/
if event.Op == fsnotify.Remove || event.Op == fsnotify.Chmod {
if event.Has(fsnotify.Remove) || event.Has(fsnotify.Chmod) {
// remove the watcher since the file is removed
if err := r.watcher.Remove(event.Name); err != nil {
r.lastReloadError = err
Expand All @@ -123,7 +123,7 @@ func (r *clientCAsFileReloader) handleWatcherEvents() {
}
r.reload()
}
if event.Op == fsnotify.Write {
if event.Has(fsnotify.Write) {
r.reload()
}
}
Expand Down

0 comments on commit c35cad9

Please sign in to comment.