Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update dependency hpcloud/tail to the successor nxadm/tail #15

Merged
merged 2 commits into from
Nov 5, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion ci/test-task.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ run:
ln -s $workspace/blackbox $GOPATH/src/code.cloudfoundry.org/blackbox
go get -u golang.org/x/tools/...
go get github.com/onsi/ginkgo
go get github.com/hpcloud/tail
go get github.com/nxadm/tail
go get github.com/onsi/gomega
go get github.com/tedsuo/ifrit
go get github.com/ziutek/syslog
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module code.cloudfoundry.org/blackbox
go 1.16

require (
github.com/hpcloud/tail v1.0.0
github.com/nxadm/tail v1.4.8
github.com/onsi/ginkgo v1.16.2
github.com/onsi/gomega v1.12.0
github.com/stretchr/testify v1.7.0
Expand Down
3 changes: 0 additions & 3 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMyw
github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/hpcloud/tail v1.0.0 h1:nfCOvKYfkgYP8hkirhJocXT2+zOD8yUNjXaWfTlyFKI=
github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU=
github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A=
github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE=
github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU=
Expand Down Expand Up @@ -92,7 +90,6 @@ google.golang.org/protobuf v1.26.0 h1:bxAC2xTBsZGibn2RTntX0oH50xLsqy1OxA9tTL3p/l
google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/fsnotify.v1 v1.4.7 h1:xOHLXZwVvI9hhs+cLKq5+I5onOuwQLhQwiu63xxlHs4=
gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys=
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ=
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw=
Expand Down
3 changes: 1 addition & 2 deletions integration/blackbox.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import (
"os"
"os/exec"
"runtime"
"strings"

. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
Expand Down Expand Up @@ -98,7 +97,7 @@ func (runner *BlackboxRunner) StartWithConfig(config blackbox.Config, tailerCoun
Name: "blackbox",
Command: blackboxCmd,
AnsiColorCode: "90m",
StartCheck: "Seeked" + strings.Repeat(".*\\n.*Seeked", tailerCount-1),
StartCheck: "Start tail...",
Cleanup: func() {
os.Remove(configPath)
},
Expand Down
4 changes: 2 additions & 2 deletions integration/syslog_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ var _ = Describe("Blackbox", func() {
Expect(message.Content).To(ContainSubstring("hello"))
Expect(message.Content).To(ContainSubstring(tagName))
Expect(message.Content).To(ContainSubstring(Hostname()))
Expect(message.Content).To(MatchRegexp(`.*\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}.\d*Z.*`))
Expect(message.Content).To(MatchRegexp(`.*\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}.\d*[Z\+].*`))

blackboxRunner.Stop()
})
Expand Down Expand Up @@ -611,7 +611,7 @@ var _ = Describe("Blackbox", func() {
Buffer: buffer,
})

Eventually(session.Err, "10s").Should(gbytes.Say("Seeked"))
Eventually(session.Err, "10s").Should(gbytes.Say("Start tail..."))

logFile.WriteString("hello\n")
logFile.WriteString("world\n")
Expand Down
5 changes: 3 additions & 2 deletions tailer.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import (
"os"
"time"

"github.com/hpcloud/tail"
"github.com/hpcloud/tail/watch"
"github.com/nxadm/tail"
"github.com/nxadm/tail/watch"

"code.cloudfoundry.org/blackbox/syslog"
)
Expand All @@ -21,6 +21,7 @@ type Tailer struct {
func (tailer *Tailer) Run(signals <-chan os.Signal, ready chan<- struct{}) error {
watch.POLL_DURATION = 1 * time.Second

tailer.Logger.Printf("Start tail...")
t, err := tail.TailFile(tailer.Path, tail.Config{
Follow: true,
ReOpen: true,
Expand Down
3 changes: 0 additions & 3 deletions vendor/github.com/hpcloud/tail/.gitignore

This file was deleted.

18 changes: 0 additions & 18 deletions vendor/github.com/hpcloud/tail/.travis.yml

This file was deleted.

63 changes: 0 additions & 63 deletions vendor/github.com/hpcloud/tail/CHANGES.md

This file was deleted.

19 changes: 0 additions & 19 deletions vendor/github.com/hpcloud/tail/Dockerfile

This file was deleted.

21 changes: 0 additions & 21 deletions vendor/github.com/hpcloud/tail/LICENSE.txt

This file was deleted.

11 changes: 0 additions & 11 deletions vendor/github.com/hpcloud/tail/Makefile

This file was deleted.

28 changes: 0 additions & 28 deletions vendor/github.com/hpcloud/tail/README.md

This file was deleted.

11 changes: 0 additions & 11 deletions vendor/github.com/hpcloud/tail/appveyor.yml

This file was deleted.

7 changes: 0 additions & 7 deletions vendor/github.com/hpcloud/tail/ratelimiter/Licence

This file was deleted.

97 changes: 0 additions & 97 deletions vendor/github.com/hpcloud/tail/ratelimiter/leakybucket.go

This file was deleted.