Docker updates: a machine without Docker answers empty, not 500

The hub used to answer this for its nodes and hid the node's 500. Now the
node answers itself, so it needs the same guard the stack list has.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Mitchell-Johnson
2026-10-10 14:58:13 -07:00
co-authored by Claude Opus 5.5
parent c27d9f0ada
commit 24a9979432
+4
View File
@@ -809,6 +809,10 @@ func checkImages(ctx context.Context, images []string) []imageCheck {
// machineUpdates checks every image on this machine in one pass, so the container list can // machineUpdates checks every image on this machine in one pass, so the container list can
// be coloured and "what is behind?" answered without walking stack by stack. // be coloured and "what is behind?" answered without walking stack by stack.
func (s *Server) machineUpdates(w http.ResponseWriter, r *http.Request) { func (s *Server) machineUpdates(w http.ResponseWriter, r *http.Request) {
if dockerTool() == "" { // no Docker is an empty answer, not a failure
jsonOK(w, 200, map[string]any{"images": []imageCheck{}, "checked": 0, "stacks": map[string][]string{}})
return
}
ctx, cancel := context.WithTimeout(r.Context(), 10*time.Minute) ctx, cancel := context.WithTimeout(r.Context(), 10*time.Minute)
defer cancel() defer cancel()
stacks, err := s.findStacks(ctx) stacks, err := s.findStacks(ctx)