Skip to content

Commit

Permalink
fix: use correct result slice for cronjob analyzer
Browse files Browse the repository at this point in the history
Signed-off-by: Patrick Pichler <git@patrickpichler.dev>
  • Loading branch information
Patrick Pichler authored and patrickpichler committed Apr 25, 2023
1 parent 8adde6b commit 947e94f
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions pkg/analyzer/cronjob.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,9 @@ func (analyzer CronJobAnalyzer) Analyze(a common.Analyzer) ([]common.Result, err
"analyzer_name": kind,
})

var results []common.Result

cronJobList, err := a.Client.GetClient().BatchV1().CronJobs(a.Namespace).List(a.Context, v1.ListOptions{})
if err != nil {
return results, err
return nil, err
}

var preAnalysis = map[string]common.PreAnalysis{}
Expand Down Expand Up @@ -114,7 +112,7 @@ func (analyzer CronJobAnalyzer) Analyze(a common.Analyzer) ([]common.Result, err
Name: key,
Error: value.FailureDetails,
}
a.Results = append(results, currentAnalysis)
a.Results = append(a.Results, currentAnalysis)
}
}

Expand Down

0 comments on commit 947e94f

Please sign in to comment.