Class: Gitlab::Kubernetes::RolloutInstances

Inherits:
Object
  • Object
show all
Includes:
Utils::StrongMemoize
Defined in:
lib/gitlab/kubernetes/rollout_instances.rb

Instance Method Summary collapse

Methods included from Utils::StrongMemoize

#clear_memoization, #strong_memoize, #strong_memoized?

Constructor Details

#initialize(deployments, pods) ⇒ RolloutInstances

Returns a new instance of RolloutInstances.


8
9
10
11
# File 'lib/gitlab/kubernetes/rollout_instances.rb', line 8

def initialize(deployments, pods)
  @deployments = deployments
  @pods = pods
end

Instance Method Details

#pod_instancesObject


13
14
15
16
17
18
19
# File 'lib/gitlab/kubernetes/rollout_instances.rb', line 13

def pod_instances
  pods = matching_pods + extra_pending_pods

  pods.sort_by(&:order).map do |pod|
    to_hash(pod)
  end
end