ecs.go 697 B

123456789101112131415161718192021222324252627282930
  1. package render
  2. import (
  3. "github.com/weaveworks/scope/report"
  4. )
  5. // ECSTaskRenderer is a Renderer for Amazon ECS tasks.
  6. var ECSTaskRenderer = Memoise(ConditionalRenderer(renderECSTopologies,
  7. renderParents(
  8. report.Container, []string{report.ECSTask}, UnmanagedID,
  9. MakeFilter(
  10. IsRunning,
  11. ContainerWithImageNameRenderer,
  12. ),
  13. ),
  14. ))
  15. // ECSServiceRenderer is a Renderer for Amazon ECS services.
  16. //
  17. // not memoised
  18. var ECSServiceRenderer = ConditionalRenderer(renderECSTopologies,
  19. renderParents(
  20. report.ECSTask, []string{report.ECSService}, "",
  21. ECSTaskRenderer,
  22. ),
  23. )
  24. func renderECSTopologies(rpt report.Report) bool {
  25. return len(rpt.ECSTask.Nodes)+len(rpt.ECSService.Nodes) >= 1
  26. }