MCPcopy Create free account
hub / github.com/docker/compose / FilterParents

Method FilterParents

pkg/compose/dependencies.go:388–402  ·  view source on GitHub ↗

FilterParents returns the parents of a certain vertex that are in a certain status

(key string, status ServiceStatus)

Source from the content-addressed store, hash-verified

386
387// FilterParents returns the parents of a certain vertex that are in a certain status
388func (g *Graph) FilterParents(key string, status ServiceStatus) []*Vertex {
389 g.lock.Lock()
390 defer g.lock.Unlock()
391
392 var res []*Vertex
393 vertex := g.Vertices[key]
394
395 for _, parent := range vertex.Parents {
396 if parent.Status == status {
397 res = append(res, parent)
398 }
399 }
400
401 return res
402}
403
404// HasCycles detects cycles in the graph
405func (g *Graph) HasCycles() (bool, error) {

Callers

nothing calls this directly

Calls 1

LockMethod · 0.45

Tested by

no test coverage detected