Skip to content

Commit fc18958

Browse files
committed
bugbot errors
1 parent 1fd96df commit fc18958

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

pkg/analyze/agents/ollama/ollama_agent.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -573,6 +573,11 @@ func (a *OllamaAgent) aggregatePodFiles(bundle *analyzer.SupportBundle, filePath
573573
namespace = strings.TrimSuffix(parts[len(parts)-1], ".json")
574574
}
575575

576+
// Initialize namespace in stats map (ensures empty namespaces are tracked)
577+
if _, exists := namespaceStats[namespace]; !exists {
578+
namespaceStats[namespace] = 0
579+
}
580+
576581
// Parse pod data - handle both PodList and single Pod objects
577582
var podList map[string]interface{}
578583
if err := json.Unmarshal(data, &podList); err != nil {
@@ -685,6 +690,11 @@ func (a *OllamaAgent) aggregateDeploymentFiles(bundle *analyzer.SupportBundle, f
685690
namespace = strings.TrimSuffix(parts[len(parts)-1], ".json")
686691
}
687692

693+
// Initialize namespace in stats map (ensures empty namespaces are tracked)
694+
if _, exists := namespaceStats[namespace]; !exists {
695+
namespaceStats[namespace] = 0
696+
}
697+
688698
// Parse deployment data - handle both DeploymentList and single Deployment objects
689699
var deploymentList map[string]interface{}
690700
if err := json.Unmarshal(data, &deploymentList); err != nil {

0 commit comments

Comments
 (0)