Skip to content

chore: pkg imported more than once #768

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

Merged
merged 1 commit into from
Jun 26, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions pkg/systemlogmonitor/log_monitor.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ import (
"k8s.io/node-problem-detector/pkg/problemmetrics"
"k8s.io/node-problem-detector/pkg/systemlogmonitor/logwatchers"
watchertypes "k8s.io/node-problem-detector/pkg/systemlogmonitor/logwatchers/types"
logtypes "k8s.io/node-problem-detector/pkg/systemlogmonitor/types"
systemlogtypes "k8s.io/node-problem-detector/pkg/systemlogmonitor/types"
"k8s.io/node-problem-detector/pkg/types"
"k8s.io/node-problem-detector/pkg/util"
Expand All @@ -50,7 +49,7 @@ type logMonitor struct {
buffer LogBuffer
config MonitorConfig
conditions []types.Condition
logCh <-chan *logtypes.Log
logCh <-chan *systemlogtypes.Log
output chan *types.Status
tomb *tomb.Tomb
}
Expand Down Expand Up @@ -147,7 +146,7 @@ func (l *logMonitor) monitorLoop() {
}

// parseLog parses one log line.
func (l *logMonitor) parseLog(log *logtypes.Log) {
func (l *logMonitor) parseLog(log *systemlogtypes.Log) {
// Once there is new log, log monitor will push it into the log buffer and try
// to match each rule. If any rule is matched, log monitor will report a status.
l.buffer.Push(log)
Expand All @@ -163,7 +162,7 @@ func (l *logMonitor) parseLog(log *logtypes.Log) {
}

// generateStatus generates status from the logs.
func (l *logMonitor) generateStatus(logs []*logtypes.Log, rule systemlogtypes.Rule) *types.Status {
func (l *logMonitor) generateStatus(logs []*systemlogtypes.Log, rule systemlogtypes.Rule) *types.Status {
// We use the timestamp of the first log line as the timestamp of the status.
timestamp := logs[0].Timestamp
message := generateMessage(logs)
Expand Down Expand Up @@ -251,7 +250,7 @@ func initialConditions(defaults []types.Condition) []types.Condition {
return conditions
}

func generateMessage(logs []*logtypes.Log) string {
func generateMessage(logs []*systemlogtypes.Log) string {
messages := []string{}
for _, log := range logs {
messages = append(messages, log.Message)
Expand Down