MCPcopy
hub / github.com/docker/compose / IsHealthy

Function IsHealthy

pkg/e2e/framework.go:411–431  ·  pkg/e2e/framework.go::IsHealthy
(service string)

Source from the content-addressed store, hash-verified

409}
410
411func IsHealthy(service string) func(res *icmd.Result) bool {
412 return func(res *icmd.Result) bool {
413 type state struct {
414 Name string `json:"name"`
415 Health string `json:"health"`
416 }
417
418 decoder := json.NewDecoder(strings.NewReader(res.Stdout()))
419 for decoder.More() {
420 ps := state{}
421 err := decoder.Decode(&ps)
422 if err != nil {
423 return false
424 }
425 if ps.Name == service && ps.Health == "healthy" {
426 return true
427 }
428 }
429 return false
430 }
431}
432
433// WaitForCmdResult try to execute a cmd until resulting output matches given predicate
434func (c *CLI) WaitForCmdResult(

Callers 1

TestLocalComposeUpFunction · 0.85

Calls

no outgoing calls

Tested by 1

TestLocalComposeUpFunction · 0.68