2017-10-03 17:24:32 -04:00
|
|
|
class ClusterProvisionWorker
|
2017-09-30 11:54:22 -04:00
|
|
|
include Sidekiq::Worker
|
2017-10-03 13:33:37 -04:00
|
|
|
include ClusterQueue
|
2017-09-30 11:54:22 -04:00
|
|
|
|
|
|
|
def perform(cluster_id)
|
2017-10-13 13:21:23 -04:00
|
|
|
Clusters::Cluster.find_by_id(cluster_id).try do |cluster|
|
2017-10-30 11:18:15 -04:00
|
|
|
cluster.provider.try do |provider|
|
|
|
|
Clusters::Gcp::ProvisionService.new.execute(provider) if cluster.gcp?
|
2017-10-13 13:21:23 -04:00
|
|
|
end
|
2017-09-30 11:54:22 -04:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|