diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-08-19 09:08:42 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-08-19 09:08:42 +0000 |
commit | b76ae638462ab0f673e5915986070518dd3f9ad3 (patch) | |
tree | bdab0533383b52873be0ec0eb4d3c66598ff8b91 /app/controllers/clusters | |
parent | 434373eabe7b4be9593d18a585fb763f1e5f1a6f (diff) | |
download | gitlab-ce-b76ae638462ab0f673e5915986070518dd3f9ad3.tar.gz |
Add latest changes from gitlab-org/gitlab@14-2-stable-eev14.2.0-rc42
Diffstat (limited to 'app/controllers/clusters')
-rw-r--r-- | app/controllers/clusters/applications_controller.rb | 56 |
1 files changed, 0 insertions, 56 deletions
diff --git a/app/controllers/clusters/applications_controller.rb b/app/controllers/clusters/applications_controller.rb deleted file mode 100644 index 91003e9580d..00000000000 --- a/app/controllers/clusters/applications_controller.rb +++ /dev/null @@ -1,56 +0,0 @@ -# frozen_string_literal: true - -class Clusters::ApplicationsController < Clusters::BaseController - before_action :cluster - before_action :authorize_create_cluster!, only: [:create] - before_action :authorize_update_cluster!, only: [:update] - before_action :authorize_admin_cluster!, only: [:destroy] - - def create - request_handler do - Clusters::Applications::CreateService - .new(@cluster, current_user, cluster_application_params) - .execute(request) - end - end - - def update - request_handler do - Clusters::Applications::UpdateService - .new(@cluster, current_user, cluster_application_params) - .execute(request) - end - end - - def destroy - request_handler do - Clusters::Applications::DestroyService - .new(@cluster, current_user, cluster_application_destroy_params) - .execute(request) - end - end - - private - - def request_handler - yield - - head :no_content - rescue Clusters::Applications::BaseService::InvalidApplicationError - render_404 - rescue StandardError - head :bad_request - end - - def cluster - @cluster ||= clusterable.clusters.find(params[:id]) || render_404 - end - - def cluster_application_params - params.permit(:application, :hostname, :pages_domain_id, :email, :stack, :host, :port, :protocol) - end - - def cluster_application_destroy_params - params.permit(:application) - end -end |