mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-24 20:24:09 +00:00
log_size_monitor shouldn't fail test in case of error
This commit is contained in:
parent
e5d4663dd8
commit
0e3c33bdec
@ -196,7 +196,7 @@ func (g *LogSizeGatherer) Run() {
|
||||
|
||||
// Work does a single unit of work: tries to take out a WorkItem from the queue, ssh-es into a given machine,
|
||||
// gathers data, writes it to the shared <data> map, and creates a gorouting which reinserts work item into
|
||||
// the queue with a <pollingPeriod> delay.
|
||||
// the queue with a <pollingPeriod> delay. Returns false if worker should exit.
|
||||
func (g *LogSizeGatherer) Work() bool {
|
||||
var workItem WorkItem
|
||||
select {
|
||||
@ -210,14 +210,21 @@ func (g *LogSizeGatherer) Work() bool {
|
||||
workItem.ip,
|
||||
testContext.Provider,
|
||||
)
|
||||
expectNoError(err)
|
||||
if err != nil {
|
||||
Logf("Error while trying to SSH to %v, skipping probe.", workItem.ip)
|
||||
g.workChannel <- workItem
|
||||
return true
|
||||
}
|
||||
results := strings.Split(sshResult.Stdout, " ")
|
||||
|
||||
now := time.Now()
|
||||
for i := 0; i+1 < len(results); i = i + 2 {
|
||||
path := results[i]
|
||||
size, err := strconv.Atoi(results[i+1])
|
||||
expectNoError(err)
|
||||
if err != nil {
|
||||
Logf("Error during conversion to int: %v, skipping data", results[i+1])
|
||||
continue
|
||||
}
|
||||
g.data.AddNewData(workItem.ip, path, now, size)
|
||||
}
|
||||
go func() {
|
||||
|
Loading…
Reference in New Issue
Block a user