Skip to content

Commit 5308411

Browse files
committed
Remove direct dependency on google/cadvisor
1 parent 9ff6b0b commit 5308411

File tree

9 files changed

+36
-69
lines changed

9 files changed

+36
-69
lines changed

go.mod

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ require (
1212
github.com/coreos/go-systemd v0.0.0-20191104093116-d3cd4ed1dbcf
1313
github.com/euank/go-kmsg-parser v2.0.0+incompatible
1414
github.com/golang/glog v1.1.1
15-
github.com/google/cadvisor v0.36.0
1615
github.com/hpcloud/tail v1.0.0
1716
github.com/onsi/ginkgo v1.16.5
1817
github.com/onsi/gomega v1.27.8

go.sum

Lines changed: 0 additions & 64 deletions
Large diffs are not rendered by default.

pkg/systemlogmonitor/logwatchers/filelog/log_watcher_linux.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import (
2121
"io"
2222
"os"
2323

24-
"github.com/google/cadvisor/utils/tail"
24+
"k8s.io/node-problem-detector/third_party/cadvisor/tail"
2525
)
2626

2727
// getLogReader returns log reader for filelog log. Note that getLogReader doesn't look back

third_party/cadvisor/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Forked from https://github.com/google/cadvisor/blob/8016f8ba96e74fb2001b121e0145dc2d0fe056e3/utils/tail/tail.go to support simple file tailing.
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
// Copyright 2016 Google Inc. All Rights Reserved.
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
15+
package tail
16+
17+
import (
18+
"io"
19+
"testing"
20+
21+
"github.com/stretchr/testify/assert"
22+
)
23+
24+
func TestReadNewTail(t *testing.T) {
25+
// Read should return (0, io.EOF) before first
26+
// attemptOpen.
27+
tail, err := newTail("test/nonexist/file")
28+
assert.NoError(t, err)
29+
buf := make([]byte, 0, 100)
30+
n, err := tail.Read(buf)
31+
assert.Equal(t, n, 0)
32+
assert.Equal(t, len(buf), 0)
33+
assert.EqualError(t, err, io.EOF.Error())
34+
}

vendor/modules.txt

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -147,9 +147,6 @@ github.com/golang/protobuf/ptypes/any
147147
github.com/golang/protobuf/ptypes/duration
148148
github.com/golang/protobuf/ptypes/timestamp
149149
github.com/golang/protobuf/ptypes/wrappers
150-
# github.com/google/cadvisor v0.36.0
151-
## explicit; go 1.13
152-
github.com/google/cadvisor/utils/tail
153150
# github.com/google/gnostic-models v0.6.8
154151
## explicit; go 1.18
155152
github.com/google/gnostic-models/compiler

0 commit comments

Comments
 (0)