Skip to content

Commit

Permalink
Merge pull request #232 from roman-kiselenko/feature/log-only-cni-con…
Browse files Browse the repository at this point in the history
…fig-files

Log events only related to a valid CNI configuration file.
  • Loading branch information
openshift-merge-bot[bot] authored Nov 18, 2024
2 parents fb3e8f2 + e129e48 commit fd63d0c
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion pkg/ocicni/ocicni.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (
"os"
"path"
"path/filepath"
"slices"
"sort"
"strings"
"sync"
Expand Down Expand Up @@ -155,10 +156,13 @@ func (plugin *cniNetworkPlugin) monitorConfDir(ctx context.Context, start *sync.
start.Done()
plugin.done.Add(1)
defer plugin.done.Done()
exts := []string{".conf", ".conflist", ".json"}
for {
select {
case event := <-plugin.watcher.Events:
logrus.Infof("CNI monitoring event %v", event)
if slices.Contains(exts, filepath.Ext(event.Name)) {
logrus.Infof("CNI monitoring event %v", event)
}

var defaultDeleted bool
createWriteRename := event.Op&fsnotify.Create == fsnotify.Create ||
Expand Down

0 comments on commit fd63d0c

Please sign in to comment.