summaryrefslogtreecommitdiff
path: root/app/controllers
diff options
context:
space:
mode:
authorShinya Maeda <shinya@gitlab.com>2017-11-07 21:23:54 +0900
committerShinya Maeda <shinya@gitlab.com>2017-11-07 21:23:54 +0900
commitbbdb0cf05141cdf9931e2aa673bf7a2ce5db0078 (patch)
treecf0e3da342c5543d817484d5130bc1e69012359a /app/controllers
parentce7b05f41d3941552320c23dc06f9f2b076099ed (diff)
parent666ab4882f2c6d385c04afe269ddf5b11f795b19 (diff)
downloadgitlab-ce-bbdb0cf05141cdf9931e2aa673bf7a2ce5db0078.tar.gz
Merge branch 'master' into 38464-k8s-apps
Diffstat (limited to 'app/controllers')
-rw-r--r--app/controllers/projects/clusters_controller.rb13
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