diff options
Diffstat (limited to 'app/controllers/clusters')
-rw-r--r-- | app/controllers/clusters/applications_controller.rb | 2 | ||||
-rw-r--r-- | app/controllers/clusters/base_controller.rb | 2 | ||||
-rw-r--r-- | app/controllers/clusters/clusters_controller.rb | 43 |
3 files changed, 25 insertions, 22 deletions
diff --git a/app/controllers/clusters/applications_controller.rb b/app/controllers/clusters/applications_controller.rb index c4e7fc950f9..54d9a36bbd2 100644 --- a/app/controllers/clusters/applications_controller.rb +++ b/app/controllers/clusters/applications_controller.rb @@ -12,7 +12,7 @@ class Clusters::ApplicationsController < Clusters::BaseController head :no_content rescue Clusters::Applications::CreateService::InvalidApplicationError render_404 - rescue StandardError + rescue head :bad_request end diff --git a/app/controllers/clusters/base_controller.rb b/app/controllers/clusters/base_controller.rb index ef42f7c4074..5a86ca39daa 100644 --- a/app/controllers/clusters/base_controller.rb +++ b/app/controllers/clusters/base_controller.rb @@ -12,7 +12,7 @@ class Clusters::BaseController < ApplicationController def cluster @cluster ||= clusterable.clusters.find(params[:id]) - .present(current_user: current_user) + .present(current_user: current_user) end def authorize_update_cluster! diff --git a/app/controllers/clusters/clusters_controller.rb b/app/controllers/clusters/clusters_controller.rb index 68a2a83f0de..9e38c74cad3 100644 --- a/app/controllers/clusters/clusters_controller.rb +++ b/app/controllers/clusters/clusters_controller.rb @@ -64,7 +64,7 @@ class Clusters::ClustersController < Clusters::BaseController head :no_content end format.html do - flash[:notice] = _('Kubernetes cluster was successfully updated.') + flash[:notice] = _("Kubernetes cluster was successfully updated.") redirect_to cluster.show_path end end @@ -78,10 +78,10 @@ class Clusters::ClustersController < Clusters::BaseController def destroy if cluster.destroy - flash[:notice] = _('Kubernetes cluster integration was successfully removed.') + flash[:notice] = _("Kubernetes cluster integration was successfully removed.") redirect_to clusterable.index_path, status: :found else - flash[:notice] = _('Kubernetes cluster integration was not removed.') + flash[:notice] = _("Kubernetes cluster integration was not removed.") render :show end end @@ -99,7 +99,7 @@ class Clusters::ClustersController < Clusters::BaseController validate_gcp_token user_cluster - render :new, locals: { active_tab: 'gcp' } + render :new, locals: {active_tab: "gcp"} end end @@ -116,7 +116,7 @@ class Clusters::ClustersController < Clusters::BaseController validate_gcp_token gcp_cluster - render :new, locals: { active_tab: 'user' } + render :new, locals: {active_tab: "user"} end end @@ -129,7 +129,7 @@ class Clusters::ClustersController < Clusters::BaseController :environment_scope, :base_domain, platform_kubernetes_attributes: [ - :namespace + :namespace, ] ) else @@ -142,7 +142,7 @@ class Clusters::ClustersController < Clusters::BaseController :api_url, :token, :ca_cert, - :namespace + :namespace, ] ) end @@ -158,12 +158,13 @@ class Clusters::ClustersController < Clusters::BaseController :zone, :num_nodes, :machine_type, - :legacy_abac - ]).merge( - provider_type: :gcp, - platform_type: :kubernetes, - clusterable: clusterable.subject - ) + :legacy_abac, + ] + ).merge( + provider_type: :gcp, + platform_type: :kubernetes, + clusterable: clusterable.subject + ) end def create_user_cluster_params @@ -176,12 +177,13 @@ class Clusters::ClustersController < Clusters::BaseController :api_url, :token, :ca_cert, - :authorization_type - ]).merge( - provider_type: :user, - platform_type: :kubernetes, - clusterable: clusterable.subject - ) + :authorization_type, + ] + ).merge( + provider_type: :user, + platform_type: :kubernetes, + clusterable: clusterable.subject + ) end def generate_gcp_authorize_url @@ -189,7 +191,8 @@ class Clusters::ClustersController < Clusters::BaseController @authorize_url = GoogleApi::CloudPlatform::Client.new( nil, callback_google_api_auth_url, - state: state).authorize_url + state: state + ).authorize_url rescue GoogleApi::Auth::ConfigMissingError # no-op end |