diff options
author | Matija Čupić <matteeyah@gmail.com> | 2017-12-16 19:02:26 +0300 |
---|---|---|
committer | Matija Čupić <matteeyah@gmail.com> | 2017-12-16 19:02:26 +0300 |
commit | 886fd13fceda053533a382d1652f9fcce475d0e1 (patch) | |
tree | 4d1e3dcf4264a0cebda9ed247c643cce11ab1f43 /app/controllers/projects/clusters | |
parent | 63859419b284ff9c4eba0a1f0df6d8d72764fc50 (diff) |
Add Worker rerun action to GcpController
Diffstat (limited to 'app/controllers/projects/clusters')
-rw-r--r-- | app/controllers/projects/clusters/gcp_controller.rb | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/app/controllers/projects/clusters/gcp_controller.rb b/app/controllers/projects/clusters/gcp_controller.rb index 34d4fd7d7ca..c965a055fdd 100644 --- a/app/controllers/projects/clusters/gcp_controller.rb +++ b/app/controllers/projects/clusters/gcp_controller.rb @@ -1,7 +1,7 @@ class Projects::Clusters::GcpController < Projects::ApplicationController before_action :authorize_read_cluster! before_action :authorize_google_api, except: [:login] - before_action :authorize_google_project_billing, except: [:login, :check] + before_action :authorize_google_project_billing, except: [:login, :check, :run_check] before_action :authorize_create_cluster!, only: [:new, :create] STATUS_POLLING_INTERVAL = 1.minute.to_i @@ -32,6 +32,15 @@ class Projects::Clusters::GcpController < Projects::ApplicationController end end + def run_check + respond_to do |format| + format.json do + CheckGcpProjectBillingWorker.perform_async(token_in_session) + head :no_content + end + end + end + def new @cluster = ::Clusters::Cluster.new.tap do |cluster| cluster.build_provider_gcp |