Class: ClusterProvisionWorker

Inherits:
Object
  • Object
show all
Includes:
ApplicationWorker, ClusterQueue
Defined in:
app/workers/cluster_provision_worker.rb

Overview

rubocop:disable Scalability/IdempotentWorker

Constant Summary

Constants included from ApplicationWorker

ApplicationWorker::LOGGING_EXTRA_KEY

Constants included from WorkerAttributes

WorkerAttributes::NAMESPACE_WEIGHTS, WorkerAttributes::VALID_RESOURCE_BOUNDARIES, WorkerAttributes::VALID_URGENCIES

Instance Method Summary collapse

Methods included from Gitlab::SidekiqVersioning::Worker

#job_version

Methods included from WorkerContext

#with_context

Instance Method Details

#perform(cluster_id) ⇒ Object


9
10
11
12
13
14
15
16
17
18
19
# File 'app/workers/cluster_provision_worker.rb', line 9

def perform(cluster_id)
  Clusters::Cluster.find_by_id(cluster_id).try do |cluster|
    cluster.provider.try do |provider|
      if cluster.gcp?
        Clusters::Gcp::ProvisionService.new.execute(provider)
      elsif cluster.aws?
        Clusters::Aws::ProvisionService.new.execute(provider)
      end
    end
  end
end