diff options
author | Shinya Maeda <shinya@gitlab.com> | 2017-11-03 21:34:13 +0300 |
---|---|---|
committer | Shinya Maeda <shinya@gitlab.com> | 2017-11-03 21:34:13 +0300 |
commit | 3278b0a5ffca9ccbe0c043b1f9ef79d0ce4af813 (patch) | |
tree | 1494208cf93df507acb65804bb7e4f66be2f990c /app/controllers/projects/clusters_controller.rb | |
parent | 8fb7e87806e8ae94ee40e56400625886cbcf411e (diff) | |
parent | db98ce38b5bdb38fae6b62298432841a1f4670f0 (diff) |
Merge branch '35616-move-gke-form-1st-iteration' into move-kubernetes-from-service-to-clusters-page-10-2-ver
Diffstat (limited to 'app/controllers/projects/clusters_controller.rb')
-rw-r--r-- | app/controllers/projects/clusters_controller.rb | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/app/controllers/projects/clusters_controller.rb b/app/controllers/projects/clusters_controller.rb index c1692ea2569..9a56c9de858 100644 --- a/app/controllers/projects/clusters_controller.rb +++ b/app/controllers/projects/clusters_controller.rb @@ -1,8 +1,8 @@ class Projects::ClustersController < Projects::ApplicationController - before_action :cluster, except: [:login, :index, :new, :create] + before_action :cluster, except: [:login, :index, :new, :new_gcp, :create] before_action :authorize_read_cluster! - before_action :authorize_create_cluster!, only: [:new, :create] - before_action :authorize_google_api, only: [:new, :create] + before_action :authorize_create_cluster!, only: [:new, :new_gcp, :create] + before_action :authorize_google_api, only: [:new_gcp, :create] before_action :authorize_update_cluster!, only: [:update] before_action :authorize_admin_cluster!, only: [:destroy] @@ -16,7 +16,7 @@ class Projects::ClustersController < Projects::ApplicationController def login begin - state = generate_session_key_redirect(namespace_project_clusters_url.to_s) + state = generate_session_key_redirect(providers_gcp_new_namespace_project_clusters_url.to_s) @authorize_url = GoogleApi::CloudPlatform::Client.new( nil, callback_google_api_auth_url, @@ -27,6 +27,9 @@ class Projects::ClustersController < Projects::ApplicationController end def new + end + + def new_gcp @cluster = Clusters::Cluster.new.tap do |cluster| cluster.build_provider_gcp end @@ -40,7 +43,7 @@ class Projects::ClustersController < Projects::ApplicationController if @cluster.persisted? redirect_to project_cluster_path(project, @cluster) else - render :new + render :new_gcp end end |