elastic / beats

:tropical_fish: Beats - Lightweight shippers for Elasticsearch & Logstash
https://www.elastic.co/products/beats
Other
96 stars 4.92k forks source link

clean up fsnotify module dependency #40921

Closed leehinman closed 1 month ago

leehinman commented 1 month ago

Currently go.mod claims that beats requires fsnotify 1.6.0

github.com/fsnotify/fsnotify v1.6.0

This is because containerd v1.7.20 requires that version. However, farther down in go.mod fsnotify is replaced with

github.com/fsnotify/fsnotify => github.com/adriansr/fsnotify v1.4.8-0.20211018144411-a81f2b630e7c

This means that all versions of fsnotify will be replaced with the one specified, which is really based on v1.4.7, further complicating things the go.mod in github.com/adriansr/fsnotify contains the following:

require (
        github.com/fsnotify/fsnotify v1.5.1
        golang.org/x/sys v0.0.0-20211007075335-d3039528d8ac
)

Which means you always get v1.5.1, even if you try to specify the exact version that adriansr/fsnotify provides. This is a complicated mess. And means that any code that uses features that are only found in 1.6.0 won't be able to find the code.

Propose the following fix.

  1. Elastic should create a new repo for a fsnotify fork, and merge in the 2 changes that are in the adriansr fork
  2. Elastic should release a 1.6.0 version and 1.7.0 version of fsnotify with the 2 changes
  3. Elastic should work on getting these changes in upstream so we don't have to maintain a fork
elasticmachine commented 1 month ago

Pinging @elastic/elastic-agent-data-plane (Team:Elastic-Agent-Data-Plane)

pierrehilbert commented 1 month ago

Closing as https://github.com/elastic/beats/pull/40956 is merged.