diff --git a/app/controllers/projects/clusters/gcp_controller.rb b/app/controllers/projects/clusters/gcp_controller.rb index 7dfe819525f..5409432e1ab 100644 --- a/app/controllers/projects/clusters/gcp_controller.rb +++ b/app/controllers/projects/clusters/gcp_controller.rb @@ -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 diff --git a/app/workers/all_queues.yml b/app/workers/all_queues.yml index 9aea3bad27b..1edfaa1691a 100644 --- a/app/workers/all_queues.yml +++ b/app/workers/all_queues.yml @@ -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 diff --git a/app/workers/check_gcp_project_billing_worker.rb b/app/workers/list_gcp_projects_worker.rb similarity index 95% rename from app/workers/check_gcp_project_billing_worker.rb rename to app/workers/list_gcp_projects_worker.rb index dd35b2de50d..12cb5f738e4 100644 --- a/app/workers/check_gcp_project_billing_worker.rb +++ b/app/workers/list_gcp_projects_worker.rb @@ -1,6 +1,6 @@ require 'securerandom' -class CheckGcpProjectBillingWorker +class ListGcpProjectsWorker include ApplicationWorker include ClusterQueue @@ -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 diff --git a/spec/controllers/projects/clusters/gcp_controller_spec.rb b/spec/controllers/projects/clusters/gcp_controller_spec.rb index 98158e081f8..3051f9cfde4 100644 --- a/spec/controllers/projects/clusters/gcp_controller_spec.rb +++ b/spec/controllers/projects/clusters/gcp_controller_spec.rb @@ -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 diff --git a/spec/workers/check_gcp_project_billing_worker_spec.rb b/spec/workers/list_gcp_projects_worker_spec.rb similarity index 98% rename from spec/workers/check_gcp_project_billing_worker_spec.rb rename to spec/workers/list_gcp_projects_worker_spec.rb index ea929fd5b01..ea94883b9a0 100644 --- a/spec/workers/check_gcp_project_billing_worker_spec.rb +++ b/spec/workers/list_gcp_projects_worker_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe CheckGcpProjectBillingWorker do +describe ListGcpProjectsWorker do describe '.perform' do let(:token) { 'bogustoken' }