Skip to content
Snippets Groups Projects
Verified Commit 3b161251 authored by Matija Čupić's avatar Matija Čupić
Browse files

Rename CheckGcpProjectBillingWorker to ListGcpProjectsWorker

parent cffc8899
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -83,12 +83,12 @@ class Projects::Clusters::GcpController < Projects::ApplicationController
end
 
def authorize_google_project_billing
redis_token_key = CheckGcpProjectBillingWorker.store_session_token(token_in_session)
CheckGcpProjectBillingWorker.perform_async(redis_token_key)
redis_token_key = ListGcpProjectsWorker.store_session_token(token_in_session)
ListGcpProjectsWorker.perform_async(redis_token_key)
end
 
def google_project_billing_status
CheckGcpProjectBillingWorker.get_billing_state(token_in_session)
ListGcpProjectsWorker.get_billing_state(token_in_session)
end
 
def token_in_session
Loading
Loading
Loading
Loading
@@ -24,7 +24,7 @@
- gcp_cluster:cluster_provision
- gcp_cluster:cluster_wait_for_app_installation
- gcp_cluster:wait_for_cluster_creation
- gcp_cluster:check_gcp_project_billing
- gcp_cluster:list_gcp_projects
- gcp_cluster:cluster_wait_for_ingress_ip_address
 
- github_import_advance_stage
Loading
Loading
require 'securerandom'
 
class CheckGcpProjectBillingWorker
class ListGcpProjectsWorker
include ApplicationWorker
include ClusterQueue
 
Loading
Loading
@@ -64,7 +64,7 @@ class CheckGcpProjectBillingWorker
 
def try_obtain_lease_for(token)
Gitlab::ExclusiveLease
.new("check_gcp_project_billing_worker:#{token.hash}", timeout: LEASE_TIMEOUT)
.new("list_gcp_projects_worker:#{token.hash}", timeout: LEASE_TIMEOUT)
.try_obtain
end
 
Loading
Loading
Loading
Loading
@@ -144,7 +144,7 @@ describe Projects::Clusters::GcpController do
before do
redis_double = double
allow(Gitlab::Redis::SharedState).to receive(:with).and_yield(redis_double)
allow(redis_double).to receive(:get).with(CheckGcpProjectBillingWorker.redis_shared_state_key_for('token')).and_return('true')
allow(redis_double).to receive(:get).with(ListGcpProjectsWorker.redis_shared_state_key_for('token')).and_return('true')
end
 
it 'creates a new cluster' do
Loading
Loading
require 'spec_helper'
 
describe CheckGcpProjectBillingWorker do
describe ListGcpProjectsWorker do
describe '.perform' do
let(:token) { 'bogustoken' }
 
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment