pull/2789/head^2
RangerCD 5 years ago committed by GitHub
parent 2dec2d2e17
commit b9534c65b3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      pkg/promtail/targets/file/filetarget.go
  2. 4
      pkg/promtail/targets/file/filetargetmanager.go
  3. 2
      pkg/promtail/targets/lokipush/pushtargetmanager.go
  4. 4
      pkg/promtail/targets/stdin/stdin_target_manager_test.go

@ -309,7 +309,7 @@ func (t *FileTarget) startTailing(ps []string) {
}
}
// stopTailingAndRemovePositions will stop the tailer and remove the positions entry.
// stopTailingAndRemovePosition will stop the tailer and remove the positions entry.
// Call this when a file no longer exists and you want to remove all traces of it.
func (t *FileTarget) stopTailingAndRemovePosition(ps []string) {
for _, p := range ps {

@ -133,8 +133,8 @@ func NewFileTargetManager(
}
func (tm *FileTargetManager) run() {
for targetGoups := range tm.manager.SyncCh() {
for jobName, groups := range targetGoups {
for targetGroups := range tm.manager.SyncCh() {
for jobName, groups := range targetGroups {
tm.syncers[jobName].sync(groups)
}
}

@ -15,7 +15,7 @@ import (
"github.com/grafana/loki/pkg/promtail/targets/target"
)
// SyslogTargetManager manages a series of PushTargets.
// PushTargetManager manages a series of PushTargets.
type PushTargetManager struct {
logger log.Logger
targets map[string]*PushTarget

@ -118,7 +118,7 @@ type fakeStdin struct {
os.FileInfo
}
func newFakeStin(data string) *fakeStdin {
func newFakeStdin(data string) *fakeStdin {
return &fakeStdin{
Reader: strings.NewReader(data),
}
@ -127,7 +127,7 @@ func newFakeStin(data string) *fakeStdin {
func (f fakeStdin) Stat() (os.FileInfo, error) { return f.FileInfo, nil }
func Test_Shutdown(t *testing.T) {
stdIn = newFakeStin("line")
stdIn = newFakeStdin("line")
appMock := &mockShutdownable{called: make(chan bool, 1)}
recorder := &clientRecorder{}
manager, err := NewStdinTargetManager(util.Logger, appMock, recorder, []scrapeconfig.Config{{}})

Loading…
Cancel
Save