Class: KnuckleCluster::TaskRegistry

Inherits:
Object
  • Object
show all
Defined in:
lib/knuckle_cluster/task_registry.rb

Instance Method Summary collapse

Constructor Details

#initialize(ecs_client:, cluster_name:, agent_registry:, hide: {}) ⇒ TaskRegistry

Returns a new instance of TaskRegistry.



6
7
8
9
10
11
# File 'lib/knuckle_cluster/task_registry.rb', line 6

def initialize(ecs_client:, cluster_name:, agent_registry:, hide: {})
  @ecs_client     = ecs_client
  @cluster_name   = cluster_name
  @agent_registry = agent_registry
  @hide           = hide
end

Instance Method Details

#containersObject



17
18
19
# File 'lib/knuckle_cluster/task_registry.rb', line 17

def containers
  tasks && all_containers
end

#containers_where(task:) ⇒ Object



25
26
27
# File 'lib/knuckle_cluster/task_registry.rb', line 25

def containers_where(task:)
  containers_by_task[task]
end

#tasksObject



13
14
15
# File 'lib/knuckle_cluster/task_registry.rb', line 13

def tasks
  @tasks ||= load_tasks.compact
end

#where(container_instance_arn:) ⇒ Object



21
22
23
# File 'lib/knuckle_cluster/task_registry.rb', line 21

def where(container_instance_arn:)
  tasks_by_container_instance_arn[container_instance_arn]
end