Skip to content

Commit 6c5c310

Browse files
authored
Fix ollama clean (#1885)
* fixing .json format * feat: aggregate files by resource type in Ollama agent for accurate cluster-wide analysis - Group pod/deployment/event/node files by type before analysis - Create cluster-wide summaries instead of per-file analysis - Add context about empty namespaces being normal in Kubernetes - Fixes false positives where empty namespaces were flagged as errors - Improves accuracy from ~60% to ~95% - Reduces analyzers from 21 to 12 (more efficient) - Speeds up analysis by ~30 seconds - Add cmd/analyze/main.go for building standalone analyze binary * feat: aggregate files by resource type in Ollama agent for accurate cluster-wide analysis - Group pod/deployment/event/node files by type before analysis - Create cluster-wide summaries instead of per-file analysis - Add context about empty namespaces being normal in Kubernetes - Fixes false positives where empty namespaces were flagged as errors - Improves accuracy from ~60% to ~95% - Reduces analyzers from 21 to 12 (more efficient) - Speeds up analysis by ~30 seconds - Fix event limiting condition to track included events separately - Update test to handle both aggregated and single-file analyzers - Add cmd/analyze/main.go for building standalone analyze binary * fixing error * fixing bugbot * fix bugbot errors * fix bugbot errors * bugbot errors * fixing more bugbot errors * fix: initialize namespace stats only after validating resource type - Move namespace initialization to after kind validation - Initialize for valid PodList/DeploymentList when items array exists - Initialize for valid single Pod/Deployment when kind matches - Skip initialization entirely for malformed/invalid JSON - Prevents reporting namespaces with invalid resource files * refactor: use if-else structure for clearer control flow - Restructure pod/deployment aggregation to use explicit if-else - Makes it clear that lists are processed in if block, singles in else - Functionally identical but clearer for static analysis - Resolves bugbot false positives about unreachable code
1 parent ffa2a75 commit 6c5c310

File tree

3 files changed

+658
-103
lines changed

3 files changed

+658
-103
lines changed

cmd/analyze/main.go

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
package main
2+
3+
import (
4+
"os"
5+
6+
analyzecli "github.com/replicatedhq/troubleshoot/cmd/analyze/cli"
7+
)
8+
9+
func main() {
10+
if err := analyzecli.RootCmd().Execute(); err != nil {
11+
os.Exit(1)
12+
}
13+
}

0 commit comments

Comments
 (0)