replace golang.org/x/exp/inotify with standalone library

context: kubernetes/kubernetes#68478

The inotify code was removed from golang.org/x/exp several years ago. Therefore
importing it from that path prevents downstream consumers from using any module
that makes use of more recent features of golang.org/x/exp.

Given that this code is by definition frozen and that the long term path should
be to migrate to fsnotify, replacing the current code by an identical standalone
copy doesn't have maintenance cost, and will unlock other activities for
kubernetes for example.
This commit is contained in:
Yann Hodique 2018-09-28 08:48:12 -07:00 committed by Sashank Appireddy
parent 43a86a3cb9
commit d8cdae8022
6 changed files with 12 additions and 7 deletions

8
Godeps/Godeps.json generated
View File

@ -763,6 +763,10 @@
"ImportPath": "github.com/seccomp/libseccomp-golang",
"Rev": "1b506fc7c24eec5a3693cdcbed40d9c226cfc6a1"
},
{
"ImportPath": "github.com/sigma/go-inotify",
"Rev": "6e160422f7699ab1472cc86362da4f009a7efc60"
},
{
"ImportPath": "github.com/sirupsen/logrus",
"Comment": "v1.0.3-11-g89742ae",
@ -803,10 +807,6 @@
"ImportPath": "golang.org/x/crypto/ssh/terminal",
"Rev": "eb71ad9bd329b5ac0fd0148dd99bd62e8be8e035"
},
{
"ImportPath": "golang.org/x/exp/inotify",
"Rev": "292a51b8d262487dab23a588950e8052d63d9113"
},
{
"ImportPath": "golang.org/x/net/context",
"Rev": "7dcfb8076726a3fdd9353b6b8a1f1b6be6811bd6"

View File

@ -17,7 +17,7 @@ package common
import (
"sync"
"golang.org/x/exp/inotify"
inotify "github.com/sigma/go-inotify"
)
// Watcher for container-related inotify events in the cgroup hierarchy.

View File

@ -26,9 +26,9 @@ import (
"github.com/google/cadvisor/container/common"
"github.com/google/cadvisor/container/libcontainer"
"github.com/google/cadvisor/manager/watcher"
inotify "github.com/sigma/go-inotify"
"github.com/golang/glog"
"golang.org/x/exp/inotify"
)
type rawContainerWatcher struct {

View File

@ -25,7 +25,7 @@ import (
"time"
"github.com/golang/glog"
"golang.org/x/exp/inotify"
inotify "github.com/sigma/go-inotify"
)
type Tail struct {

5
vendor/github.com/sigma/go-inotify/README.md generated vendored Normal file
View File

@ -0,0 +1,5 @@
This is a fork of golang.org/x/exp/inotify before it was deleted.
Please use gopkg.in/fsnotify.v0 instead.
For updates, see: https://fsnotify.org/