Commit 1385d700 authored by Kamil Trzcinski's avatar Kamil Trzcinski

Fix routes

parent d502ce59
...@@ -7,7 +7,7 @@ class Projects::Clusters::GcpController < Projects::ApplicationController ...@@ -7,7 +7,7 @@ class Projects::Clusters::GcpController < Projects::ApplicationController
def login def login
begin begin
state = generate_session_key_redirect(providers_gcp_new_namespace_project_clusters_url.to_s) state = generate_session_key_redirect(new_namespace_project_gcp_url.to_s)
@authorize_url = GoogleApi::CloudPlatform::Client.new( @authorize_url = GoogleApi::CloudPlatform::Client.new(
nil, callback_google_api_auth_url, nil, callback_google_api_auth_url,
......
class Projects::Clusters::KubernetesController < Projects::ApplicationController class Projects::Clusters::UserController < Projects::ApplicationController
before_action :authorize_read_cluster! before_action :authorize_read_cluster!
before_action :authorize_create_cluster!, only: [:new, :create] before_action :authorize_create_cluster!, only: [:new, :create]
......
...@@ -7,6 +7,6 @@ ...@@ -7,6 +7,6 @@
= icon('chevron-down') = icon('chevron-down')
%ul.dropdown-menu.clusters-dropdown-menu.dropdown-menu-full-width %ul.dropdown-menu.clusters-dropdown-menu.dropdown-menu-full-width
%li %li
= link_to(s_('ClusterIntegration|Create cluster on Google Container Engine'), providers_gcp_new_namespace_project_clusters_path(@project.namespace, @project)) = link_to(s_('ClusterIntegration|Create cluster on Google Container Engine'), new_namespace_project_gcp_path(@project.namespace, @project))
%li %li
= link_to(s_('ClusterIntegration|Add an existing cluster'), platforms_kubernetes_new_namespace_project_clusters_path(@project.namespace, @project)) = link_to(s_('ClusterIntegration|Add an existing cluster'), new_namespace_project_user_path(@project.namespace, @project))
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
- link_to_help_page = link_to(s_('ClusterIntegration|help page'), help_page_path('user/project/clusters/index'), target: '_blank', rel: 'noopener noreferrer') - link_to_help_page = link_to(s_('ClusterIntegration|help page'), help_page_path('user/project/clusters/index'), target: '_blank', rel: 'noopener noreferrer')
= s_('ClusterIntegration|Read our %{link_to_help_page} on cluster integration.').html_safe % { link_to_help_page: link_to_help_page} = s_('ClusterIntegration|Read our %{link_to_help_page} on cluster integration.').html_safe % { link_to_help_page: link_to_help_page}
= form_for @cluster, html: { class: 'prepend-top-20' }, url: providers_gcp_namespace_project_clusters_path(@project.namespace, @project), as: :cluster do |field| = form_for @cluster, html: { class: 'prepend-top-20' }, url: namespace_project_gcp_path(@project.namespace, @project), as: :cluster do |field|
= form_errors(@cluster) = form_errors(@cluster)
.form-group .form-group
= field.label :name, s_('ClusterIntegration|Cluster name') = field.label :name, s_('ClusterIntegration|Cluster name')
......
...@@ -5,16 +5,9 @@ ...@@ -5,16 +5,9 @@
.col-sm-4 .col-sm-4
= render 'sidebar' = render 'sidebar'
.col-sm-8 .col-sm-8
- if @project.deployment_platform&.active?
%h4.prepend-top-0= s_('ClusterIntegration|Cluster management')
%p= s_('ClusterIntegration|A cluster has been set up on this project through the Kubernetes integration page')
= link_to s_('ClusterIntegration|Manage Kubernetes integration'), edit_project_service_path(@project, :kubernetes), class: 'btn append-bottom-20'
- else
%h4.prepend-top-0= s_('ClusterIntegration|Choose how to set up cluster integration') %h4.prepend-top-0= s_('ClusterIntegration|Choose how to set up cluster integration')
%p= s_('ClusterIntegration|Create a new cluster on Google Engine right from GitLab') %p= s_('ClusterIntegration|Create a new cluster on Google Engine right from GitLab')
= link_to s_('ClusterIntegration|Create on GKE'), providers_gcp_new_namespace_project_clusters_path(@project.namespace, @project), class: 'btn append-bottom-20' = link_to s_('ClusterIntegration|Create on GKE'), new_namespace_project_gcp_path(@project.namespace, @project), class: 'btn append-bottom-20'
%p= s_('ClusterIntegration|Enter the details for an existing Kubernetes cluster') %p= s_('ClusterIntegration|Enter the details for an existing Kubernetes cluster')
= link_to s_('ClusterIntegration|Add an existing cluster'), platforms_kubernetes_new_namespace_project_clusters_path(@project.namespace, @project), class: 'btn append-bottom-20' = link_to s_('ClusterIntegration|Add an existing cluster'), new_namespace_project_user_path(@project.namespace, @project), class: 'btn append-bottom-20'
= form_for @cluster, url: platforms_kubernetes_namespace_project_clusters_path(@project.namespace, @project), as: :cluster do |field| = form_for @cluster, url: namespace_project_user_path(@project.namespace, @project), as: :cluster do |field|
= form_errors(@cluster) = form_errors(@cluster)
.form-group .form-group
= field.label :name, s_('ClusterIntegration|Cluster name') = field.label :name, s_('ClusterIntegration|Cluster name')
......
...@@ -185,12 +185,12 @@ constraints(ProjectUrlConstrainer.new) do ...@@ -185,12 +185,12 @@ constraints(ProjectUrlConstrainer.new) do
resources :clusters, except: [:edit, :create] do resources :clusters, except: [:edit, :create] do
collection do collection do
get '/platforms/kubernetes/new', to: 'clusters/kubernetes#new' scope :providers do
post '/platforms/kubernetes', to: 'clusters/kubernetes#create' resource :user, only: [:new, :create], controller: 'clusters/user'
resource :gcp, only: [:new, :create], controller: 'clusters/gcp' do
get '/providers/gcp/new', to: 'clusters/gcp#new' get :login
get '/providers/gcp/login', to: 'clusters/gcp#login' end
post '/providers/gcp', to: 'clusters/gcp#create' end
end end
member do member do
......
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