Commit 20abcbff authored by Shinya Maeda's avatar Shinya Maeda

Add google_api to TOP_LEVEL_ROUTES. Import/Export model failure fix. Fix static analysys.

parent c6d53250
...@@ -10,8 +10,7 @@ class Projects::ClustersController < Projects::ApplicationController ...@@ -10,8 +10,7 @@ class Projects::ClustersController < Projects::ApplicationController
begin begin
@authorize_url = GoogleApi::CloudPlatform::Client.new( @authorize_url = GoogleApi::CloudPlatform::Client.new(
nil, callback_google_api_authorizations_url, nil, callback_google_api_authorizations_url,
state: namespace_project_clusters_url.to_s state: namespace_project_clusters_url.to_s).authorize_url
).authorize_url
rescue GoogleApi::Auth::ConfigMissingError rescue GoogleApi::Auth::ConfigMissingError
# no-op # no-op
end end
......
...@@ -10,8 +10,7 @@ module Ci ...@@ -10,8 +10,7 @@ module Ci
cluster.gcp_cluster_zone, cluster.gcp_cluster_zone,
cluster.gcp_cluster_name, cluster.gcp_cluster_name,
cluster.gcp_cluster_size, cluster.gcp_cluster_size,
machine_type: cluster.gcp_machine_type machine_type: cluster.gcp_machine_type)
)
rescue Google::Apis::ServerError, Google::Apis::ClientError, Google::Apis::AuthorizationError => e rescue Google::Apis::ServerError, Google::Apis::ClientError, Google::Apis::AuthorizationError => e
return cluster.errored!("Failed to request to CloudPlatform; #{e.message}") return cluster.errored!("Failed to request to CloudPlatform; #{e.message}")
end end
......
...@@ -53,6 +53,7 @@ project_tree: ...@@ -53,6 +53,7 @@ project_tree:
- :auto_devops - :auto_devops
- :triggers - :triggers
- :pipeline_schedules - :pipeline_schedules
- :clusters
- :services - :services
- :hooks - :hooks
- protected_branches: - protected_branches:
......
...@@ -8,6 +8,7 @@ module Gitlab ...@@ -8,6 +8,7 @@ module Gitlab
triggers: 'Ci::Trigger', triggers: 'Ci::Trigger',
pipeline_schedules: 'Ci::PipelineSchedule', pipeline_schedules: 'Ci::PipelineSchedule',
builds: 'Ci::Build', builds: 'Ci::Build',
clusters: 'Gcp::Cluster',
hooks: 'ProjectHook', hooks: 'ProjectHook',
merge_access_levels: 'ProtectedBranch::MergeAccessLevel', merge_access_levels: 'ProtectedBranch::MergeAccessLevel',
push_access_levels: 'ProtectedBranch::PushAccessLevel', push_access_levels: 'ProtectedBranch::PushAccessLevel',
......
...@@ -33,6 +33,7 @@ module Gitlab ...@@ -33,6 +33,7 @@ module Gitlab
explore explore
favicon.ico favicon.ico
files files
google_api
groups groups
health_check health_check
help help
......
...@@ -49,11 +49,10 @@ module GoogleApi ...@@ -49,11 +49,10 @@ module GoogleApi
"name": cluster_name, "name": cluster_name,
"initial_node_count": cluster_size, "initial_node_count": cluster_size,
"node_config": { "node_config": {
"machine_type": machine_type # Default 3.75 GB, if ommit "machine_type": machine_type
} }
} }
} } )
)
service.create_cluster(project_id, zone, request_body) service.create_cluster(project_id, zone, request_body)
end end
......
...@@ -147,6 +147,10 @@ deploy_keys: ...@@ -147,6 +147,10 @@ deploy_keys:
- user - user
- deploy_keys_projects - deploy_keys_projects
- projects - projects
clusters:
- project
- user
- service
services: services:
- project - project
- service_hook - service_hook
...@@ -177,6 +181,7 @@ project: ...@@ -177,6 +181,7 @@ project:
- tag_taggings - tag_taggings
- tags - tags
- chat_services - chat_services
- cluster
- creator - creator
- group - group
- namespace - namespace
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment