mirror of
https://github.com/k8sgpt-ai/k8sgpt.git
synced 2025-09-09 03:01:16 +00:00
fix: use coreAnalyzer if there are no filters selected and no active_filters (#432)
Signed-off-by: Matthis Holleville <matthish29@gmail.com>
This commit is contained in:
@@ -128,7 +128,7 @@ func NewAnalysis(backend string, language string, filters []string, namespace st
|
||||
func (a *Analysis) RunAnalysis() {
|
||||
activeFilters := viper.GetStringSlice("active_filters")
|
||||
|
||||
analyzerMap := analyzer.GetAnalyzerMap()
|
||||
coreAnalyzerMap, analyzerMap := analyzer.GetAnalyzerMap()
|
||||
|
||||
analyzerConfig := common.Analyzer{
|
||||
Client: a.Client,
|
||||
@@ -138,11 +138,11 @@ func (a *Analysis) RunAnalysis() {
|
||||
}
|
||||
|
||||
semaphore := make(chan struct{}, a.MaxConcurrency)
|
||||
// if there are no filters selected and no active_filters then run all of them
|
||||
// if there are no filters selected and no active_filters then run coreAnalyzer
|
||||
if len(a.Filters) == 0 && len(activeFilters) == 0 {
|
||||
var wg sync.WaitGroup
|
||||
var mutex sync.Mutex
|
||||
for _, analyzer := range analyzerMap {
|
||||
for _, analyzer := range coreAnalyzerMap {
|
||||
wg.Add(1)
|
||||
semaphore <- struct{}{}
|
||||
go func(analyzer common.IAnalyzer, wg *sync.WaitGroup, semaphore chan struct{}) {
|
||||
|
Reference in New Issue
Block a user