summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorShinya Maeda <shinya@gitlab.com>2017-10-04 16:04:45 +0900
committerShinya Maeda <shinya@gitlab.com>2017-10-04 16:04:45 +0900
commit20abcbffae71f8177223f2b978c8ad56102da271 (patch)
tree629fb9a3af6015233bac78d19ecf2b01bb52bf84 /app
parentc6d53250de7f439bc25740913d85ada6e3b2fed4 (diff)
downloadgitlab-ce-20abcbffae71f8177223f2b978c8ad56102da271.tar.gz
Add google_api to TOP_LEVEL_ROUTES. Import/Export model failure fix. Fix static analysys.
Diffstat (limited to 'app')
-rw-r--r--app/controllers/projects/clusters_controller.rb5
-rw-r--r--app/models/gcp/cluster.rb2
-rw-r--r--app/services/ci/fetch_gcp_operation_service.rb2
-rw-r--r--app/services/ci/finalize_cluster_creation_service.rb2
-rw-r--r--app/services/ci/provision_cluster_service.rb11
5 files changed, 10 insertions, 12 deletions
diff --git a/app/controllers/projects/clusters_controller.rb b/app/controllers/projects/clusters_controller.rb
index 8d07f695e78..5dbabaf7813 100644
--- a/app/controllers/projects/clusters_controller.rb
+++ b/app/controllers/projects/clusters_controller.rb
@@ -9,9 +9,8 @@ class Projects::ClustersController < Projects::ApplicationController
def login
begin
@authorize_url = GoogleApi::CloudPlatform::Client.new(
- nil, callback_google_api_authorizations_url,
- state: namespace_project_clusters_url.to_s
- ).authorize_url
+ nil, callback_google_api_authorizations_url,
+ state: namespace_project_clusters_url.to_s).authorize_url
rescue GoogleApi::Auth::ConfigMissingError
# no-op
end
diff --git a/app/models/gcp/cluster.rb b/app/models/gcp/cluster.rb
index 74644207afd..81af8161b8f 100644
--- a/app/models/gcp/cluster.rb
+++ b/app/models/gcp/cluster.rb
@@ -48,7 +48,7 @@ module Gcp
validates :gcp_cluster_zone, presence: true
validates :gcp_cluster_size, presence: true,
- numericality: { only_integer: true, greater_than: 0 }
+ numericality: { only_integer: true, greater_than: 0 }
validates :project_namespace,
allow_blank: true,
diff --git a/app/services/ci/fetch_gcp_operation_service.rb b/app/services/ci/fetch_gcp_operation_service.rb
index 24892d1ab47..415afaf901f 100644
--- a/app/services/ci/fetch_gcp_operation_service.rb
+++ b/app/services/ci/fetch_gcp_operation_service.rb
@@ -1,7 +1,7 @@
module Ci
class FetchGcpOperationService
def execute(cluster)
- api_client =
+ api_client =
GoogleApi::CloudPlatform::Client.new(cluster.gcp_token, nil)
operation = api_client.projects_zones_operations(
diff --git a/app/services/ci/finalize_cluster_creation_service.rb b/app/services/ci/finalize_cluster_creation_service.rb
index 03cd761deb7..a469acc0467 100644
--- a/app/services/ci/finalize_cluster_creation_service.rb
+++ b/app/services/ci/finalize_cluster_creation_service.rb
@@ -1,7 +1,7 @@
module Ci
class FinalizeClusterCreationService
def execute(cluster)
- api_client =
+ api_client =
GoogleApi::CloudPlatform::Client.new(cluster.gcp_token, nil)
begin
diff --git a/app/services/ci/provision_cluster_service.rb b/app/services/ci/provision_cluster_service.rb
index 3e7e565b361..6fcbdd8b483 100644
--- a/app/services/ci/provision_cluster_service.rb
+++ b/app/services/ci/provision_cluster_service.rb
@@ -6,12 +6,11 @@ module Ci
begin
operation = api_client.projects_zones_clusters_create(
- cluster.gcp_project_id,
- cluster.gcp_cluster_zone,
- cluster.gcp_cluster_name,
- cluster.gcp_cluster_size,
- machine_type: cluster.gcp_machine_type
- )
+ cluster.gcp_project_id,
+ cluster.gcp_cluster_zone,
+ cluster.gcp_cluster_name,
+ cluster.gcp_cluster_size,
+ machine_type: cluster.gcp_machine_type)
rescue Google::Apis::ServerError, Google::Apis::ClientError, Google::Apis::AuthorizationError => e
return cluster.errored!("Failed to request to CloudPlatform; #{e.message}")
end