File tree Expand file tree Collapse file tree 1 file changed +14
-6
lines changed Expand file tree Collapse file tree 1 file changed +14
-6
lines changed Original file line number Diff line number Diff line change @@ -9,11 +9,19 @@ import (
99func (h * handler ) healthcheck (w http.ResponseWriter , r * http.Request ) {
1010 log .Trace ().Msg ("Healthcheck request received" )
1111
12- _ , errors := h .multiHostService .ListAllContainers ()
13- if len (errors ) > 0 {
14- log .Error ().Err (errors [0 ]).Msg ("Error listing containers" )
15- http .Error (w , "Error listing containers" , http .StatusInternalServerError )
16- } else {
17- w .WriteHeader (http .StatusOK )
12+ for _ , host := range h .multiHostService .Hosts () {
13+ if host .Type == "agent" {
14+ log .Debug ().Str ("host" , host .ID ).Msg ("Skipping agent host" )
15+ continue
16+ }
17+
18+ _ , err := h .multiHostService .ListContainersForHost (host .ID )
19+ if err != nil {
20+ log .Error ().Err (err ).Str ("host" , host .ID ).Msg ("Error listing containers" )
21+ http .Error (w , "Error listing containers" , http .StatusInternalServerError )
22+ return
23+ }
1824 }
25+
26+ w .WriteHeader (http .StatusOK )
1927}
You can’t perform that action at this time.
0 commit comments