swarm.go 470 B

12345678910111213141516171819202122
  1. package render
  2. import (
  3. "github.com/weaveworks/scope/report"
  4. )
  5. // SwarmServiceRenderer is a Renderer for Docker Swarm services
  6. //
  7. // not memoised
  8. var SwarmServiceRenderer = ConditionalRenderer(renderSwarmTopologies,
  9. renderParents(
  10. report.Container, []string{report.SwarmService}, UnmanagedID,
  11. MakeFilter(
  12. IsRunning,
  13. ContainerWithImageNameRenderer,
  14. ),
  15. ),
  16. )
  17. func renderSwarmTopologies(rpt report.Report) bool {
  18. return len(rpt.SwarmService.Nodes) >= 1
  19. }