Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKamil Trzciński <ayufan@ayufan.eu>2018-02-14 18:59:33 +0300
committerKamil Trzciński <ayufan@ayufan.eu>2018-02-14 18:59:33 +0300
commitfa1134ea832019f74e20444fcfdf42e76195d321 (patch)
tree08c31a95786a9849c49dea73d9d87945acf63f35 /app/controllers/projects
parent5d1088c2a899f709cc9bdf30af0bdbfea81be09e (diff)
parentf95d9fdcc5f52e6371ca78b21538e87e9ba738f1 (diff)
Merge branch '41722-track-gcp-billing-enabled-project-changes' into 'master'
Resolve "Track GCP Billing enabled project changes" Closes #41722 See merge request gitlab-org/gitlab-ce!16962
Diffstat (limited to 'app/controllers/projects')
-rw-r--r--app/controllers/projects/clusters/gcp_controller.rb14
1 files changed, 6 insertions, 8 deletions
diff --git a/app/controllers/projects/clusters/gcp_controller.rb b/app/controllers/projects/clusters/gcp_controller.rb
index 94d33b91562..0f41af7d87b 100644
--- a/app/controllers/projects/clusters/gcp_controller.rb
+++ b/app/controllers/projects/clusters/gcp_controller.rb
@@ -39,12 +39,12 @@ class Projects::Clusters::GcpController < Projects::ApplicationController
def verify_billing
case google_project_billing_status
- when 'true'
- return
- when 'false'
- flash[:alert] = _('Please <a href=%{link_to_billing} target="_blank" rel="noopener noreferrer">enable billing for one of your projects to be able to create a Kubernetes cluster</a>, then try again.').html_safe % { link_to_billing: "https://console.cloud.google.com/freetrial?utm_campaign=2018_cpanel&utm_source=gitlab&utm_medium=referral" }
- else
+ when nil
flash[:alert] = _('We could not verify that one of your projects on GCP has billing enabled. Please try again.')
+ when false
+ flash[:alert] = _('Please <a href=%{link_to_billing} target="_blank" rel="noopener noreferrer">enable billing for one of your projects to be able to create a Kubernetes cluster</a>, then try again.').html_safe % { link_to_billing: "https://console.cloud.google.com/freetrial?utm_campaign=2018_cpanel&utm_source=gitlab&utm_medium=referral" }
+ when true
+ return
end
@cluster = ::Clusters::Cluster.new(create_params)
@@ -81,9 +81,7 @@ class Projects::Clusters::GcpController < Projects::ApplicationController
end
def google_project_billing_status
- Gitlab::Redis::SharedState.with do |redis|
- redis.get(CheckGcpProjectBillingWorker.redis_shared_state_key_for(token_in_session))
- end
+ CheckGcpProjectBillingWorker.get_billing_state(token_in_session)
end
def token_in_session