Skip to content
This repository was archived by the owner on Mar 9, 2025. It is now read-only.

Commit dc34ea7

Browse files
committed
Fixing nil error if deployment has no pods
1 parent 97b2a62 commit dc34ea7

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

pkg/dashboard/server/agentApi.go

+9-9
Original file line numberDiff line numberDiff line change
@@ -152,15 +152,15 @@ func state(w http.ResponseWriter, r *http.Request) {
152152

153153
w.WriteHeader(http.StatusOK)
154154

155-
alertStateManager, _ := r.Context().Value("alertStateManager").(*alert.AlertStateManager)
156-
for _, stack := range stacks {
157-
err := alertStateManager.TrackPods(stack.Deployment.Pods)
158-
if err != nil {
159-
logrus.Errorf("cannot track pods: %s", err)
160-
http.Error(w, http.StatusText(500), 500)
161-
return
162-
}
163-
}
155+
// alertStateManager, _ := r.Context().Value("alertStateManager").(*alert.AlertStateManager)
156+
// for _, stack := range stacks {
157+
// err := alertStateManager.TrackPods(stack.Deployment.Pods)
158+
// if err != nil {
159+
// logrus.Errorf("cannot track pods: %s", err)
160+
// http.Error(w, http.StatusText(500), 500)
161+
// return
162+
// }
163+
// }
164164

165165
agentHub, _ := r.Context().Value("agentHub").(*streaming.AgentHub)
166166
agent := agentHub.Agents[name]

0 commit comments

Comments
 (0)